Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Problem with STRING translations in other languages - please help me!

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: 839 Views
  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Problem with STRING translations in other languages - please help me! Link to this post

    I'm confused

    I try to make strings translatable but it doesn't work for me.. Translations in CMS works, translation in template with CurrentLang works but when I put the string, from lang array comes translation only for 1 language and other labguages shows default text from string.

    In config I have this:

    i18n::enable();
    i18n::set_locale('lt_LT');
    i18n::set_default_lang('lt');
    HTTP::set_cache_age(0);

    In page:

    function CurrentLang() {
    return Translatable::current_lang();
    }

    Currently in template I have this:

    <% if CurrentLang = lt %>tralialia<% end_if %>

    But I want to have this:

    <% _t('STRING' , 'tralialia') %>

    I created catalog 'lang' in 'mysite' and created files for lang array in different languages.

    Where can be my mistake?

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