Jump to:

23364 Posts in 18125 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Own translation table (Category: Multilingual)

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

Page: 1
Go to End
Author Topic: 1000 Views
  • Gizmo0811
    Avatar
    Community Member
    2 Posts

    Own translation table (Category: Multilingual) Link to this post

    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

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: Own translation table (Category: Multilingual) Link to this post

    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

  • Gizmo0811
    Avatar
    Community Member
    2 Posts

    Re: Own translation table (Category: Multilingual) Link to this post

    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

    1000 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.