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.

General Questions /

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

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

Own translation table (Category: Multilingual)


Go to End


3 Posts   1851 Views

Avatar
Gizmo0811

Community Member, 2 Posts

10 February 2009 at 9:00pm

Hi together,

I'm just rebuilding our company web site and need to add i18n support. No problem so far: I've added
HTTP::set_cache_age(0);
i18n::enable();
i18n::set_default_lang('de');
i18n::set_locale('de_DE');
to the _config.php and the result is as expected. The token are translated to the related language as given in the de_DE.php file.

Now the question:
How ist it possible to use an own de_DE.php file stored in an project related folder (i.e. mysite/code/lang)? It's because in case of an Silverstripe Update the changes/addition in the "original" cms/lang folder will be lost.

Your community help is very appreciated.

Best regards,
Gizmo0811

Avatar
schellmax

Community Member, 126 Posts

11 February 2009 at 2:08am

Edited: 11/02/2009 2:14am

i was also wondering how to achieve this.
currently i'm using the lang files to give the page classes in the cms ('create' dropdown above the sitetree) meaningful captions, but i'm quite sure that i'll forget about these changes after an update...

btw: as using HTTP::set_cache_age(0); will disable all caching, this may slow down your website considerably. in case you need a multilingual frontend which doesn't suffer from this drawback, you might be interested to an alternative approach i published in the docs:
http://doc.silverstripe.org/doku.php?id=recipes:multilingual_content

Avatar
Gizmo0811

Community Member, 2 Posts

11 February 2009 at 8:05am

Hi shellmax,

thanx for your help. But I'm not quite sure if I should use that "workaroud" because in the current project I am just looking for an eays way to translate some phrases of the PageCommentInterface class.

The cache-thing: This is just for develoment time and will be disabled after some test before rolling out to production. But thanx for that hint ;o)

Maybe someone else has an idea how to use their own translation tables (i.e. de_DE.php)??

Cheers