Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

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

LoginForm and i18n::set_locale()?


Go to End


2 Posts   1930 Views

Avatar
a5s

Community Member, 1 Post

22 October 2009 at 9:05pm

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!

Avatar
Ingo

Forum Moderator, 801 Posts

2 November 2009 at 8:45am

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.