Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » LoginForm and i18n::set_locale()?

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

Page: 1
Go to End
Author Topic: 1552 Views
  • a5s
    Avatar
    Community Member
    1 Post

    LoginForm and i18n::set_locale()? Link to this post

    Hi,

    I've a multilanguage-site and I created a custom form

    class MyLoginForm extends LoginForm ...

    everything works fine (This forum was and is allways a good help!). Also if I have selected German, then when the form is displayed, it is allways set to english and i18n::get_locale() will allways output en_US. All other Pages are in German.

    In page.php was "de_DE" set with:

    i18n::set_locale($this->dataRecord->Locale);

    Do anyone know why or where is it set to en_US? Did I anything wrong?

    i18n::set_locale('de_DE');

    works im my class MyLoginForm. But sometimes user select en_US.

    How can I set language in my form? How can I access to the property $this->dataRecord->Locale out of my class MyLoginForm?

    Thanks!

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: LoginForm and i18n::set_locale()? Link to this post

    Hm, how do you access your custom login form? Did you override the Security/login DIrector rule?

    > Also if I have selected German, then when the form is displayed, it is allways set to english
    So you've selected it by i18n::set_locale(), right? The user-specific settings in profile popup won't have any effect before logging in.

    1552 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.