Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

Translations


Reply

2 Posts   363 Views

Avatar
Chimera

5 November 2013 at 10:24am Community Member, 10 Posts

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 %>

Avatar
Chimera

7 November 2013 at 10:17pm (Last edited: 7 November 2013 10:19pm), Community Member, 10 Posts

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');