I have downloaded the translatable module and use 2 languages on my site:
In my _vonfig.php file i added the following.
i18n::set_locale('sv_SE');
// i18n::set_locale('en_GB'); //this i had to remove because i get an error
Translatable::set_default_locale('sv_SE');
Translatable::set_allowed_locales(array(
'sv_SE',
'en_GB',
));
SiteTree::add_extension('Translatable');
SiteConfig::add_extension('Translatable');
And in mysite/code/page.php
I wanted to add the following, but i had to remove it because it will generate an error
public function init() {
parent::init();
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
I can have to language of the site but the _t dont work, do anyone have an idea what is wrong.
Update: When i add the following to _config.php
i18n::set_locale('en_GB');
SOLVED: I had a tab intendention in language yaml file instead of 4 spaces... ;-(