Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » [ImageGallery] Translatable Problems

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 6353 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    Did you make the changes to CMSMain.php and ComplexTableField.php as noted in #4435?
    http://open.silverstripe.org/attachment/ticket/4435/ctf-translatable-fix.patch

    I've checked in the patch for DOM, but you'll still have to do the patch manually for the other two files.

  • Xeal
    Avatar
    Community Member
    37 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    I've applied the changes and from what I can see so far I'm able to add as many albums as I want, but I can't add photos and I can't add dates to Calendar events. Nonetheless this is good progress because I couldn't even access these pages in the cms before without it bugging on me. Thanks for that link UC! Saved me a bunch of searching =). Now to get the photos and events to work

    EDIT

    There seems to be a bug even with my english version of the site atm... Can't add photos are add date times to events anymore either.

  • UncleCheese
    Avatar
    4085 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    What do you mean? What happens?

  • Xeal
    Avatar
    Community Member
    37 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    Well I've posted a Screenshot of what I'm getting as a screen on my event calendar, as for the photo album. When I go to add a picture, I get a blank popup with only the close button appearing, or The upload picture form opens in the same window (without the popup).

  • Richie
    Avatar
    Community Member
    18 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    If someone can shed any light on what I need to do to get it working, I would be happy to take a look and implement the change.

    Any Silverstripe-core-dev people reading along? I think 'multilingual content and DOM' working together would be really interesting to a lot of us.

    UncleCheese, thanks for your great work!

  • wmk
    Avatar
    Community Member
    44 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    Hi,

    uncle cheese asked me to explain how i got dataobjects working with translatable, see http://www.silverstripe.org/dataobjectmanager-module-forum/show/260986?start=24#post267112

    At the moment translatable doesn't work, cause even ComplexTableField, Dataobjectmanager extends, cannot handle locale. There is a patch http://open.silverstripe.org/ticket/4435 which adds the locale parameter to all urls of CTF, i made another for passing locale with DOM, see http://open.silverstripe.org/ticket/4492

    This for now fixes the "I can't handle sub-URLs of a CMSMain object" Bug.

    So far so good.

    I haven't used image gallery yet, so i don't know what you did. I'm also pretty new to Silverstripe but may have some php skills.

    In my project i have used translation decorator ONLY for the pages, not for the dataobjects. The way translation currently works, is, that it makes a complete translation of ALL items, so a completely new item. Not so good for image galleries.

    A (maybe hackish) approach would be, to add e.g. title_en, title_de, title_nl to each picture and make a custom getter which returns title depending on the current locale. So you only have some fields translated but not the picture.

    hope that helps a little bit - i sometimes hang around in IRC #silverstripe if you prefer real time discussion ;)

    EDIT:

    in my current project i have a many-to-many relationship between translated page and dataobjects. so i easily have them available in all pages and translations. see my later post on translation groups for a possible way in has_one relationships

  • UncleCheese
    Avatar
    4085 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    Awesome. Thanks for your input, wmk! I had a sense that was the issue.

  • wmk
    Avatar
    Community Member
    44 Posts

    Re: [ImageGallery] Translatable Problems Link to this post

    just installed a image gallery module on a test server. nice work, uncle cheese!

    but the problem with translateable seems to be much more complicated.

    making a translation of a page creates a new page with a new page ID. So the new (translated) gallery has to know the original gallery pageID.

    Maybe http://doc.silverstripe.com/doku.php?id=multilingualcontent#translating_custom_properties Translatable_Transformation can help there (the only silverstripe on the horizon i found in docs).

    problems: which page is the original page? only the one created in default locale? doesn't seem so. translation offers "translation groups" (table SiteTree_translationgroups in database), so DOM has to filter the current albums by "translation group" instead of $this->pageID.

    uncle cheese: how to get the database join to get all possilbe pageIDs in the translation group in DOM?

    translatable::getTranslationGroup() can give you the current translation group, the rest could be done with the filter statement.

    with this step we could at least have the albums of the other translations available. next would be to translate album title etc...

    hth for now.

    6353 Views
Page: 1 2 3 4 5
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.