Hi,
I feel like I must be missing something here and am not sure what. I'm running Silverstripe 2.4.2 and have configured Translatable and i18n as follows in my _config.php file.
<?php
/* ...
*/
Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale("en_CA");
i18n::enable();
global $allowed_locales;
$allowed_locales = array(
'fr_CA' => array('French (Canada)', 'français'),
'en_CA' => array('English (Canada)', 'English'),
);
i18n::$common_locales = $allowed_locales;
i18n::set_locale('en_CA');
I have been successful in creating pages in both english and french and the standard CMS fields (Page name, Navigation label, Content) all allow me to set different content in either of those languages.
However, I have added a CMS field as follows:
class LandingPage extends Page {
public static $db = array(
'ViewProjectLabel' => 'Text'
);
/* ... */
function getCMSFields() {
$fields = parent::getCMSFields();
$viewprojectlabel = new TextField('ViewProjectLabel', 'View Project Label/Voir le projet');
$fields->addFieldToTab('Root.Content.Settings', $viewprojectlabel);
return $fields;
}
}
/* ... */
This field does not show up as the others do. Regardless which version of the page I'm editing (english or french) the field is always the same. The others show up as the familiar pairs of editable Content and greyed out Original Content.
Do I have to do anything else when I set up this field to indicate that I would like it to set different values for it in each language?
Please let me know if you need more info from me.
Peter