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.

Template Questions /

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

Multilingual WebSite


Go to End


2 Posts   1615 Views

Avatar
Tonyair

Community Member, 81 Posts

10 June 2010 at 8:39am

Hello, guys.
I was managed to do multilingual website, everything works perfect, but locale switching

I have 2 files en_US.php and ru_RU.php in mysite/lang/ folder there're some params for templates, like:

$lang['en_US']['Page.ss']['BTN_FEEDBACK'] = 'feedback'; inside en_US.php

when i changing language of website content is changing and function Translatable::get_current_locale() returns en_US, content is changing, but those variables are still taken from ru_RU.php file.

I tried to add self::set_current_locale(Translatable::get_current_locale()); in Page_Controller->init(); and nothing has changed

Avatar
Tonyair

Community Member, 81 Posts

10 June 2010 at 8:42am

Sorry, just solved that problem =)

i18n::set_locale(Translatable::get_current_locale());