Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » i18n problem... :/

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

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

Page: 1
Go to End
Author Topic: 1067 Views
  • pIscIs
    Avatar
    Community Member
    8 Posts

    i18n problem... :/ Link to this post

    hi again,
    so i have another problem, this time with i18 translations. My default locale is lt_LT(setted in _config.php).
    so then i add <% _t('veks_login', 'Prisijungti') %> to template it returns an error -
    ---------------------------------------------------------------
    FATAL ERROR: - Locale file /lang/en_US.php should exist
    At line 1252 in /home/veks/domains/veks....lt/public_html/sapphire/core/i18n.php
    ---------------------------------------------------------------
    i added a line(1245) to i i18n.php :
    if(empty($module)) $module = Director::baseFolder(); now it finds the locale file, then i added another file with Lithuanian locale - lt_LT.php with source:
    ---------------------------------------------------------------
    <?php
    i18n::include_locale_file('veks', 'lt_LT'); //my site code dir is veks

    global $lang;

    $lang['lt_LT'] = $lang['lt_LT'];
    $lang['lt_LT']['veks_login'] = 'Prisijungti';
    ?>
    ---------------------------------------------------------------
    and putted it into site root in folder lang. same to en_EN.php, but nothing happens then switching languages.

    Please help.

  • pIscIs
    Avatar
    Community Member
    8 Posts

    Re: i18n problem... :/ Link to this post

    So i found were the problem was. I was creating template in themes dir, then i moved all my templates to site dir all started to work, but were is a one bug - ?lang=other_lang not setting the locale(i18n::set_locale() not executing), thats why nothing happened, so i placed some if statments in page controler constructor and now all working fine.

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