22857 Posts in 9972 Topics by 2805 members
|Go to End|
25 August 2009 at 9:08pm Last edited: 25 August 2009 9:09pm
Hi there, I'm trying since days now, to get familiar with the single/multilanguage support in Silverstripe. The Backend was no Problem. Page Types I added with lang folder and de_DE.php and en_US.php files are translated correctly to the chosen backend language. But in the frontend it doesn't seem to work.
First I did nothing to my _config.php and so in every module english was chosen (testing with event_calender and image_galary).
After adding the following three lines (also tried all other combinations with only one or two lines) I recieved a language Dropdown in the Backend which was set to english.
changing the dropdown to german resulted in an empty Pagetree. I then changed all locale entries inside the database to de_DE and now I have the Full Sitetree under german and english is empty. Fine, that's working, but the modules do not seem to be translated. I added a de_DE.php to the image_galary but that didn't work. Making changes to the en_US.php which are not shown in the frontend tell me, that the translation file isn't taken by silverstripe and it uses the default Text (second argument of _t()).
Do I have to set another parameter to activate the translation in the frontend or are these three lines enough and there might be some other issues?
26 August 2009 at 2:48am
Is there anyone with a Solution to my Problem, I can't imagine, that this is not an all Day Task which can be solved with just one or two further lines of code.
26 August 2009 at 9:31pm
Hi Andre, What version of SS are you using?
To the best of my knowledge "i18n::enable();" is not required since 2.3.2 but "Object::add_extension('SiteTree', 'Translatable');" is required to enable the translatable functionality.
14 September 2009 at 6:23am
Will it be enough if I add Translation for Sitetree? What if I have a has_many relation on a Page Object which includes a bunch of Dataobjects? Will they be translatet, because of their Parentobject which is of class SiteTree?
|Go to Top|