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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Translations


Go to End


2 Posts   1515 Views

Avatar
Chimera

Community Member, 10 Posts

5 November 2013 at 10:24am

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

Community Member, 10 Posts

7 November 2013 at 10:17pm

Edited: 07/11/2013 10:19pm

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