How can I override the default language set in the dashboard.

Permalink 2 users found helpful
My page is usually in German and it use the german messages.po by default. On some pages, I want that to use the English messages.po.

I thought that I achieve it with the following code:
Localization::changeLocale('en_US');


What unfortunately is not the case.
Can you give me a tip?

Thanks

Asseco
 
Mainio replied on at Permalink Reply
Mainio
Yeah, that does not work, have put that function to the core.

In this language patch:
http://www.concrete5.org/developers/bugs/5-5-2-1/fix-that-not-trans...

You can find an updated version of the libraries/localization.php which should fix this.
Mainio replied on at Permalink Reply
Mainio
By the way, probably an easier solution would be to just change the default language of that user account. Because you can have an account-specific language for the users.
Asseco replied on at Permalink Reply
Asseco
Thanks, for your info.

Unfortunately, I also get no change with your file and the different languages has to apply to all users.

But if I use this code, then the language is changed:
Config::save('SITE_LOCALE', 'en_US');

Unfortunately, only after the second load.

Do you have any other advice?
Asseco replied on at Permalink Reply
Asseco
Does anyone have any idea how I control the t-function [ t('string') ], so that I can select the output language of a page.
Asseco replied on at Permalink Best Answer Reply
Asseco
Localization::changeLocale('en_US')
is the solution