Dear Members,
I'd like to ask you for my following problems with Version 2.4.2. I need for my new project multilanguage. I read many topics for this problem. But I don't think I have the right solution for that.
I need to languages german and english us. I copied this code in my _config.php:
// add multilanguage Support
i18n::set_locale('de_DE');
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable'); // 2.4 or newer only
Translatable::set_default_locale('de_DE');
In my Page.php I wrote:
public function init() {
parent::init();
if($this->dataRecord->hasExtension('Translatable')){
i18n::set_locale($this->dataRecord->Locale);
}
The main problem is that I don't understand what is the correct code for my version 2.4.2.
A bIg problem is: I have the menu with languages in the backend but if do /dev/build with the database. I get in my english us profile a new category. I don't understand that? I tryed to delete that not necessary categories with batch action - I can't delete them only in the german profile?
Is there any tip for that problem or a better solution with multilanguage???
Thanks for the help!