Hi, I'm really trying for a long time and tried to get familiar with the i18n and multilinugualcontent documentations
http://doc.silverstripe.org:80/doku.php?id=i18n&s=translation
http://doc.silverstripe.org:80/doku.php?id=multilingualcontent&s=translation
But I don't get it.
What I want is a simple Page (to start with first, later there will be relations with dataobjects, but lets keep it simple first) with 2 or more Languages.
So I added the following to my _config.php
// add multilanguage Support
i18n::set_locale('de_DE');
Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale('de_DE');
This Way I got german for the Frontend Language and the Pagecomments module translatet to german too. Fine, in the Backend I have a languagdropdown now, which shows my default Pagetree is german. When clicking the translation tab and saving the page to an new language, I get a second sitetree for this language. The Pages in the second Sitetree all have a different url so it is not working for to get the translatet site only by adding the locale variable to the url (/home-de?locale=en_GB does show the german content and only /home-en shows the translatet page).
I found the following and added it to the init function of my Page_controller.
if($this->dataRecord->hasExtension('Translatable')){
i18n::set_locale($this->dataRecord->Locale);
}
but nothing is changing.
So my question is at first, how to use the translation? When translating a site it seems, a new Page Object is created, but how is it related to it's sibling in other languages?
Next Question, if I change to URL /home-de?locale=en_GB or /home-en, the Pagecomments are still translated to german. How do I have to Tell Silverstripe which language is chosen for the moment? (same for Modules that should be available for multilanguages)
Last question, is there a simple way to have nice URLs for Translation like /de/home and /en/home?
I know there is an existing tutorial about that but it's nearly thwo years old and based on Silverstripe 2.0 or 2.2.