Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » TranslatableDataObject as a replacement of Translatable

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 570 Views
  • Marcinkonys
    Avatar
    Community Member
    11 Posts

    TranslatableDataObject as a replacement of Translatable Link to this post

    Hello SilverStripers,

    I just have a simple question: can the TranslatableDataObject module be used as a replacement for the Translatable module?

    I'm going to develop a website in two languages, and have tried Translatable in the past, but was wondering whether a multilingual site can be maintained using a single SiteTree.

    Having not used DataObjects too much (actually, I don't think I created anything but Page subclasses in my previous SS project...), I was wondering whether I'll actually be able to translate different Page types somehow?

    Thanks in advance,
    Martin

  • UncleCheese
    Avatar
    4085 Posts

    Re: TranslatableDataObject as a replacement of Translatable Link to this post

    Yes, you can use them pretty much interchangeably, but keep in mind that the Translatable module is much more scalable and stable. TranslatableDataObject is good for translating DataObject content (obviously), and also for adding simple translation features to SiteTree page types.

    Unlike Translatable, TranslatableDataObject creates translations in columns, not rows, so if you have lots of languages and objects with lots of translatable fields, you run into a real scalability problem.

    Translatable module:
    | ID | Title | Locale |
    --------------------------
    | 2 | Home | en_US |
    | 3 | Acceuil | fr_FR |

    TranslatableDataObject
    | ID | Title | Title__fr_FR |
    ----------------------------------
    | 2 | Home | Acceuil |

  • UncleCheese
    Avatar
    4085 Posts

    Re: TranslatableDataObject as a replacement of Translatable Link to this post

    It's also important to note that they're not mutually exclusive. I use them cooperatively on my i18n sites. Translatable for the SiteTree, and TranslatableDataObject for everything else.

  • Marcinkonys
    Avatar
    Community Member
    11 Posts

    Re: TranslatableDataObject as a replacement of Translatable Link to this post

    Thanks for the reply, UncleCheese. Could you give a really simple example of how you'd use them both in the same site? Just to get a better understanding. The main difference I see between the two is that Translatable allows translating Page object fields, and TranslatableDataObject does the same with DataObject fields, right?

  • ayandyan
    Avatar
    Community Member
    6 Posts

    Re: TranslatableDataObject as a replacement of Translatable Link to this post

    Hi UncleCheese,

    You mentioned you're using the modules Translatable & TranslatableDataObject cooperatively on your site. I think I'm only left with this option at this point. May I ask what SS version you are using (3.0 or 3.1)?

    I'm trying out the prelease version of SS 3.1 because the Translatable module (https://github.com/silverstripe/silverstripe-translatable#requirements) they released requires this version specifically and that the DataObject translation is in effect. I tested it and the SiteTree translation works (as it always had), but then again the DataObject translation still doesn't work. I'm just stuck with an unresponsive Create button for translating DataObjects with no errors in the console.

    I hope you can enlighten me on this. Thanks much.

    P.S.

    Adding this line in the config file:

    Object::add_extension('MyDataObject', 'Translatable');

    brings up the Translations tab, but when I go in there the Create button doesn't do anything.

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