Jump to:

2002 Posts in 1422 Topics by 616 members

Form Questions

SilverStripe Forums » Form Questions » multilingual form messages

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1331 Views
  • yurigoul
    Avatar
    Community Member
    202 Posts

    multilingual form messages Link to this post

    Hi,

    I have a multilingual site (NL, DE, US) where NL is set as the default language, i18n.js is loaded but the contact form only uses sapphire/javascript/lang/en_US.js for the error messages, no matter what language I am in. The result is that all the messages on the form appear in US-English only ('Please fill out "Name*", it is required.' etc).

    I have done my dev/builds and whatever and I put everything I could find regarding translatable, default languages, i18n in mysite/_config.php and everything else is working just fine (my http-equiv="Content-Language" says content="de-DE",
    got a language menu that works and even got the google sitemap extension working for sitemap.xml in different languages - and used a sitemap-index.xml for my robots.txt with links to them all)

    Anyone?

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: multilingual form messages Link to this post

    GOT IT! Forgot to add:

    public function init() {
          parent::init();

          if($this->dataRecord->hasExtension('Translatable')) {
             i18n::set_locale($this->dataRecord->Locale);
          }
    }

    1331 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.