Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » multilingual site / master language

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2388 Views
  • superautomatic
    Avatar
    Community Member
    53 Posts

    multilingual site / master language Link to this post

    Hi.

    I'm trying out the multilingual functionality in 2.2rc3, and it seems to work pretty nice. I have one question though: Is it not possible to create new pages in the second language (or any other language than the master language)? Let me give you an example:

    I have a top-level page named Employees. Under this page I want to give each employee in each country an own page. So on the English page, I might have:

    Employees
    - Alan
    - Martin
    - Dave

    But the Swedish page will have:

    Anstallda (employees)
    - Anna
    - Richard
    - Kenneth
    - Caroline

    At the moment the "create" button is dimmed when in "translation mode", so I cant create new pages for the Swedish translation only. Am I doing something wrong, or is this something thats been up for discussion?

    /Jens

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: multilingual site / master language Link to this post

    you're right, thats a use-case we've missed when architecting the system. currently each translation has to be connected to a page in the "master language" ("en" by default). thats why "create" is disabled if you're in translation mode.
    As a quick fix (hack?) you can try to make the "ShowInMenus" property translatable (which essentially means it stores this flag separately for each language), and disable it on translation-basis.

    class Page extends SiteTree {
    static $extensions = array("Translatable('ShowInMenus')",);
    }

    not entirely sure if this works, but worth giving it a try...

  • superautomatic
    Avatar
    Community Member
    53 Posts

    Re: multilingual site / master language Link to this post

    Ok. I think this is a pretty important multilingual functionality in a real-life scenario. I'll try your hack and report back how it works, but I don't think that its optimal for endusers to handle it this way. Maybee this should be a feature in upcoming releases?

  • pjssms
    Avatar
    Community Member
    49 Posts

    Re: multilingual site / master language Link to this post

    Is that option available on 2.2.3 ?

    How can i use it ?

  • briansohn
    Avatar
    Community Member
    5 Posts

    Re: multilingual site / master language Link to this post

    Hello Ingo,

    I was wondering if anybody got the following solution to work:

    class Page extends SiteTree {
    static $extensions = array("Translatable('ShowInMenus')",);
    }

    I tried it and it broke my site.

    The ability to create a page in another translation (that is not the default language) is a critical feature to my site. I was wondering if this is a part of the roadmap for v2.3

    I was also looking for any other topics for this issue, seeing if anybody had a solution to it. After a thorough search, I am assuming this is the only thread.

    Do you have any suggestions to create this feature in SilverStripe. You guys have a fantastic CMS, keep up the good work!

    Thanks for your help,

    Brian Sohn

  • briansohn
    Avatar
    Community Member
    5 Posts

    Re: multilingual site / master language Link to this post

    Hello,

    I have digged in to this issue and I have some ideas on how to deal with this issue of translations trying to create master pages in more than one language.

    I am currently trying to implement the following:

    1) Switch the default language when viewing the respective admin. I.e. set the default language as Swedish when looking at the Swedish admin.

    2) I will alter/extend the buildSQL in DataObject.php to filter out any primary pages that are not Swedish (pulling from SiteTree), and to INCLUDE pages that were translated in to Swedish from other languages (pulling from SiteTree_lang). This will involve adding a "language" field to the the Page.php so that all pages in SiteTree have a corresponding language type.

    I was wondering if anybody had any feedback on this. I'm hoping that I explained things properly here.

    Thanks,

    Brian Sohn

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