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.

Customising the CMS

mutilingual: official versus the hack


Reply

6 Posts   842 Views

Avatar
yurigoul

16 December 2009 at 3:00am (Last edited: 16 December 2009 3:02am), Community Member, 202 Posts

I would like to know the opinion, experiences, advice and pointers to hacks from the people in this forum regarding the two ways to create multilingual sites and their drawbacks:

The [url=http://doc.silverstripe.org/doku.php?id=multilingualcontent]official way to create a multilingual site[/url] enables the use of multiple site trees/menu structures. However those site trees are not connected to one another. This means:

  • - For every page you want to translate, you have to tell the cms to create a translation (i.e. a new page in a new language) for you. This is not done automatically.
  • - If you change the location of a page in the site tree (change the menu structure) the location of that page in the translations is not changed accordingly, i.e. you have to change the position of all the pages in all your translations
  • - if you remove one page in one of the languages, the pages still exists in the other languages

In some instances this is the right thing to have, for example a firm with branches in several countries, and those branches have to operate independent of one another but still need a common look and certain pages need to correspond to one another. However, in this case I would probably try and find another solution for this, but YMMV.

Enter the [url=http://doc.silverstripe.org/doku.php?id=recipes:multilingual_content]unofficial way[/url]: Every language has an extra tab in the interface of a page. Managing the structure of a multilingual website is much easier in this case. My opinion: from a usability point of view this is much easier. However:

  • - How does this work out for things like search?
  • - How does this workout for things like numbers and dates and currency?
  • - Will this hack still be possible in the future?

What are your opinions on this, what are your experiences?

Avatar
ajshort

16 December 2009 at 8:13am Community Member, 244 Posts

The unofficial way is defunct, there is no real reason to use it since the translatable system was refactored in 2.3.2 (as is stated very clearly on the wiki page).

Avatar
yurigoul

16 December 2009 at 8:32am Community Member, 202 Posts

I respectfully disagree, think there is a very real reason to use the unofficial way:

- If I have created a page called 'Spinach' and I move the page from the food section into the vegetable section, I expect the same page in the other languages to be in the same section after I am done.
- If I create a page called 'Piza' I expect that page to be there in other languages as well.

AFAIK this can not be done using the official way.

(This might work for 2 languages in a site that is not too big, but as soon as you are talking about 4 languages in a site that has 100 or more pages, this becomes problematic - this is not hypothetical, and it is not a food website either:-))

Avatar
Pigeon

16 December 2009 at 11:29am Community Member, 243 Posts

Having worked on a someone else's project that used the 'hacked' version, i can say it is the most horrible thing to try and use. It is a hack and it doesn't work properly.

It breaks some modules and searching is a nightmare! Stay away, it will just lead to SO much more hassle and limit what is possible.

Avatar
yurigoul

16 December 2009 at 11:36am Community Member, 202 Posts

Thanks for the answer. I must say I suspected something like that.

Anybody knows of a way to at least make the official way more like the unofficial - like for instance create a page in every language at the same time?

Avatar
Pigeon

21 December 2009 at 2:06pm Community Member, 243 Posts

I'm sure you can overload the onCreate (or similar) method that will create a page in all the sitetrees, same with unpublish, delete, etc. So that they would all be synced.

In fact, i am slightly surprised that isnt standard :P