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.

Archive

Our old forums are still available as a read-only archive.

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

Multilingual site with a default language


Reply

5 Posts   4373 Views

Avatar
artemb

27 July 2008 at 10:49pm Community Member, 11 Posts

Hi all!

I have got a website in 2 languages: English and Russian. When a user first visits the website, he sees the English translation. How can I make Russian the default language? I have tried i18n::set_default_language('ru') but instead of making the site look russian by default, it made the language switch in the CMS go away. Please, help.

With best regards,
Artem B.

Avatar
artemb

31 July 2008 at 12:19am Community Member, 11 Posts

I'm really confused. In the _config.php file I set

i18n::enable();
Translatable::set_default_lang('ru');

Then I set a breakpoint on Translatable::current_lang() and see that it always returns "ru", Why then the site is loaded in English first?

Please, help!

With best regards,
Artem B.

Avatar
artemb

1 August 2008 at 8:37pm Community Member, 11 Posts

Guys, I really need help with this problem.

I have a website with nothing but a homepage translated into 2 languages - English and Russian. My goal is to show russian version by default and let the user switch to english if he likes.

Now, whenever a user visits the site it displays english version of the home page by default. If I visit /?lang=ru it displays russian.

I have tried to set i18n::set_default_lang('ru') which completely disables any multi-lingual content and makes the site show the english page even if I add ?lang=ru to the url.

If anyone has any idea about how to do that, please tell. I would really like some expertease on this.

Avatar
alfa

1 August 2008 at 8:50pm (Last edited: 1 August 2008 8:58pm), Community Member, 20 Posts

That's weird,

I have a site with default language set on Bulgarian and English to switch by ?lang=en.

So it should work with:

i18n::enable();
i18n::set_default_lang('ru');

And when you enter the CMS the default language set to add things will be Russian, when you change it in the CMS to English (for example) and you leave the CMS set on English the website will be in English.. so before you leave let it on Russian again.

Dispite that, with those strings added in your _config.php everything should work (i have it that way and it works) ^^ maybe it's a good idea when you do it to flush the cache ?flush=1

hope you make it!

EDIT:

Well if everything still goes on a mess, you can save your work and start making a new page with the translation mode enabled..this way it should by everything ok ^^

Cheers,

Avatar
artemb

1 August 2008 at 9:08pm Community Member, 11 Posts

It seems like you have to start with your default language from the very beginning and THEN translate pages to the secondary (english in my case). I have started the site from scratch and that fixed the problem.

Thank you, alfa, DesignCity and simon_w!