Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Multilingual site with relationships

Go to End

2 Posts   2087 Views


Community Member, 18 Posts

29 November 2009 at 5:09am


I am developing a web site for a alternative reality game aimed at school children using Silverstripe. The problem is that while I am doing this in English the first round of the game will take part in Germany and therefore I need to translate all the content. I have enabled multilingual content but am a bit confused how to make this work as all the pages in German get their own ID assigned in the database and I have a lot of relationships depending on the page id or dataobject id (for example all the Tasks are saved as individual pages and the code to unlock them are stored as dataobjects).

Can i use translation groups for this? Or is this not really feasible in Silverstripe at the moment?



Forum Moderator, 801 Posts

2 December 2009 at 9:57pm

Interesting project, I'd love to see it linked here once its gone live :)

So you've read through, right?
I'm not sure if I get your datamodel, but as a rule of thumb: As long as you relate any has_one/has_many/many_many DataObjects directly to a SiteTree object, they should be associated to the correct language (assuming you filter them properly in the view, e.g. a ComplexTableField inside Page->getCMSFIelds()). The DataObject records themselves won't automatically have a locale set, and there's no CMS-based interface for "adding a translation".

As an alternative to the CMS-based editing, consider using our "translatable modeladmin" module: Its pretty early stage, but if you have a look through its code, you should get a feeling for whats involved to make things like ComplexTableField work with Translatable.