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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Multilingual page with secured pages


Go to End


1714 Views

Avatar
pali

Community Member, 33 Posts

16 July 2010 at 11:15pm

hello,

i just created multilingual website (default language is slovak sk_SK, second language is english en_US). SS = 2.4.0

my _config.php looks like this:

Translatable::set_default_locale('sk_SK');
Object::add_extension('SiteTree','Translatable');
Object::add_extension('SiteConfig','Translatable');
Translatable::set_allowed_locales(array('sk_SK','en_US'));

and myste/Page.php -> controller's init() includes:

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

Everything works great except one thing - I have one secured page (created in slovak and translated to english) which looks like this if not logged in:

Slovak language:
Menu -> Slovak sitetree
Note ($lang['xx_XX']['Security']['NOTEPAGESECURED']) -> is from english lang file (but is translated in Sapphire's Slovak lang file, should use this one)
Fields (email, password, button) and lost password -> in Slovak

English language: looks exactly same as slovak

Probably its caused, because visitor is redirected to login page like this: DOMAIN/Security/login?BackURL=%2Fxyz%2F and Security doest check, which language is "xyz" ?

Also, there is somthing wrong with "Note" whic is all the time in english. If i add in _config.php this:

i18n::set_locale("sk_SK");

i get correct Note (in Slovak).

If i change it to i18n::set_locale("en_US") , Note is correctly in english, but for fields are in Slovak.

Probably, Note depends on i18n, all other parts on translatable setup.

Any hint?

Regards

pali