Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Problems adding new language File

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: 1040 Views
  • webair
    Avatar
    Community Member
    8 Posts

    Problems adding new language File Link to this post

    Hi

    I have problems creating a custom language File for my module. i followed the instruction from the i18n docs, but my translation file doesn't get loaded.

    my module is called event and has a Layout called Event.ss. In there i call for example <% _t('INFORMATION','__TEST__') %>. in my language file i wrote:

    global $lang;
    $lang['en_US']['Event.ss']['INFORMATION'] = 'Event information';

    but it does not appear when i view my page. Also i can make syntax errors or var_dumps in the lang file without getting them displayed. Can anyone help me here?

    i run silverstripe 2.4.1

    Thanks alot,

    webair

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Problems adding new language File Link to this post

    Removing ['Event.ss'] in the lang string should solve this.

  • webair
    Avatar
    Community Member
    8 Posts

    Re: Problems adding new language File Link to this post

    Thanks for the answer.

    sadly it didn't worked. it seems like the language file from the module doesn't get loaded. but i don't know why...

    best regards
    webair

    [EDIT] here my config settings for the i18n and translatable

    i18n::set_default_lang('de');
    i18n::set_locale('de_CH');
    i18n::$common_locales['fr_CH'] = array('French (Switzerland)', 'fran&ccedil;ais (Suisse)');

    Translatable::set_default_locale('de_CH');
    Translatable::set_allowed_locales(array('de_CH','en_US','fr_CH'));

    [EDIT]

    1040 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.