Jump to:

3397 Posts in 978 Topics by 854 members

Template Questions

SilverStripe Forums » Template Questions » Translations

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

Page: 1
Go to End
Author Topic: 282 Views
  • Chimera
    Avatar
    Community Member
    10 Posts

    Translations Link to this post

    Hi,

    i have multilingual website. My config is below. When i run text collector, files cs.yml are created with cs lang. But in config i have cs_CZ lang set. This would not matter so much, but when i create en.yml with en lang and translated text, than EN translated text is displayed in cs lang too and original lang text from cs is not visible. Can you help me ? Thanks.

    // Set the site locale
    Translatable::set_default_locale("cs_CZ");
    $allowed_locales = array(
    'cs_CZ' => array('CZ', 'Česky'),
    'en_US' => array('EN', 'English'),
    );
    i18n::$common_locales = $allowed_locales;
    i18n::set_default_locale('cs_CZ');
    i18n::set_locale('cs_CZ');
    i18n::set_locale('en_EN');

    Second question is if i can use partial caching with translation blocks like this :

    <% Locale.Nice %>
    <legend><%t BranchFilter.name "Název" %></legend>
    <% end_cached %>

  • Chimera
    Avatar
    Community Member
    10 Posts

    Re: Translations Link to this post

    Hi,

    i implemented the latest SS 3.1 and the latest tranlatable module and now i have a opposite problem. When i create tranlation file en.yml or en_US.yml, i cant see the translation on front in this language after flush? Someone ? Thanks.

    _config.php

    SiteTree::add_extension('Translatable');
    SiteConfig::add_extension('Translatable');
    Translatable::set_default_locale("cs_CZ");
    Translatable::set_allowed_locales(array('cs_CZ','en_US'));

    i18n::set_default_locale('cs_CZ');
    i18n::set_locale('cs_CZ');

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