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.

General Questions

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

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

SS 2.3.3 Translatable & browser language settings


Reply

4 Posts   1334 Views

Avatar
karibe

17 September 2009 at 9:03pm Community Member, 56 Posts

Hello

I'm upgrading ss cmsed site to multi language version. How can I read browser language settings to set up site serving language?

Avatar
karibe

23 September 2009 at 1:14am Community Member, 56 Posts

Impossible? Nobody knows?

Avatar
dalesaurus

23 September 2009 at 2:52am Community Member, 283 Posts

You'll need to write a small bit of code to read the User Agent and switch the language.

1. Figure out the language, likely with $_SERVER["HTTP_ACCEPT_LANGUAGE"]
2. Switch it automatically, likely in your init() of Page_Controller. You can find the code to switch on the wiki:

http://doc.silverstripe.com/doku.php?id=recipes:pretty_i18n_urls

http://doc.silverstripe.com/doku.php?id=recipes:multilingual_content

Avatar
one

3 October 2009 at 6:05pm Community Member, 6 Posts

Hello

A lot of people have the same problem.
Just Like BUGS!

I think that better,
From a beginning, Admin get possible to manage language.