We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create dir: TranslatableDataObject _config.php => empty TranslatableDataObject\code\TranslatableDataObject.php
Copy to server main dir not into mysite\code\ single file class
Otherwise class will be load before i18n and lang will be default en_us to all pages __
Translatable::set_default_locale('en_US'); Translatable::set_allowed_locales(array('en_US', 'it_IT')); SiteTree::add_extension('Translatable');
TranslatableDataObject::set_langs(array( 'IT', 'EN' ));
Don't try en_US', 'it_IT:
In Page.php add:
public function init() { parent::init(); if($this->dataRecord->hasExtension('Translatable')) { i18n::set_locale($this->dataRecord->Locale); } }
Finally:
foreach($this->getTranslationFields(null, "IT") as $field) { $f->addFieldToTab("Root.IT", $field); }
not
foreach($this->getTranslationFields(null, "it_IT") as $field) { $f->addFieldToTab("Root.IT", $field); }
__
Its hard to be Silverstripe noob ;)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Create dir:
TranslatableDataObject
_config.php => empty
TranslatableDataObject\code\TranslatableDataObject.php
Copy to server main dir not into mysite\code\ single file class
Otherwise class will be load before i18n and lang will be default en_us to all pages
__
Translatable::set_default_locale('en_US');
Translatable::set_allowed_locales(array('en_US', 'it_IT'));
SiteTree::add_extension('Translatable');
TranslatableDataObject::set_langs(array(
'IT',
'EN'
));
Don't try en_US', 'it_IT:
In Page.php add:
public function init() {
parent::init();
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
}
Finally:
not
__
Its hard to be Silverstripe noob ;)
The text was updated successfully, but these errors were encountered: