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.

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   2018 Views

Avatar
rino

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?

Avatar
Ingo

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 http://groups.google.com/group/silverstripe-dev/browse_frm/thread/7a4c8bb74f01aecc. 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! :)

Avatar
rino

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 (www.rosa.com) 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!