Jump to:

5514 Posts in 1733 Topics by 1219 members

Customising the CMS

SilverStripe Forums » Customising the CMS » mutilingual: official versus the hack

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

Page: 1
Go to End
Author Topic: 824 Views
  • yurigoul
    Avatar
    Community Member
    202 Posts

    mutilingual: official versus the hack Link to this post

    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 official way to create a multilingual site 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 unofficial way: 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?

  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: mutilingual: official versus the hack Link to this post

    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).

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: mutilingual: official versus the hack Link to this post

    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:-))

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: mutilingual: official versus the hack Link to this post

    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.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: mutilingual: official versus the hack Link to this post

    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?

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: mutilingual: official versus the hack Link to this post

    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

    824 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.