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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

serious problems with i18n

Go to End

3 Posts   1747 Views


Community Member, 12 Posts

24 May 2008 at 2:58am

Edited: 24/05/2008 3:01am

i use the 2.2.1 version of silverstripe.

has someone ever really implemented a proper i18n-page with silverstripe? i have serious problems with it:

where do you implement the mapping logic for mapping the language (en, de, fr etc.) to the locale (en_US, en_UK, de_DE, de_CH, fr_FR etc.)?

i guess one has to map de->de_DE or fr->fr_FR for example if you want to have german and french content and user interface...

i tried to implement the mapping in the init() method of Page_Controller in Page.php, but then some parts of the website don't get the right locale (for example when i try to recover my password and i type in a wrong email address, i get only en_US error messages...).

the i18n documentation is kind of poor so it only tells how to set the locale and read the locale, but doesnt say anything about how EXACTLY and WHERE EXACTLY to implement the i18n logic of switching languages...

can someone help?


Forum Moderator, 801 Posts

24 May 2008 at 11:13am

> where do you implement the mapping logic for mapping the language (en, de, fr etc.) to the locale (en_US, en_UK, de_DE, de_CH, fr_FR etc.)?
you've uncovered an architectural oversight in the implementation - we were assuming short locales for frontend context, long locales for CMS contexts, but templates always use lookup tables with long locales, and can be used in both contexts. hence the mapping, which should happen automatically in the future (e.g. when requesting "de", you'd get "de_DE" by default).

integration of i18n was only possible because we got 3 solid months of development time sponsored by Google - its a good start, but lots to improve. there has been recent offers for help in i18n, see the thread also contains a list of outstanding tickets (feel free to raise the missing mapping there). we need help from the community to polish i18n - and can provide guidance if you want to contribute! :)


Community Member, 12 Posts

26 May 2008 at 8:38pm

thanx ingo for your answer.

i'm new to silverstripe and i really want to understand the ideas behind the framework and implementations. the company i work for in switzerland ( is also interested in contributing code improvements and new features.

i will also try to add a ticket about the language<->locale mapping, would be nice if one could do it in a configurative way in the future.

keep up your good work!