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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

multilingual site / master language


Go to End


6 Posts   3709 Views

Avatar
superautomatic

Community Member, 53 Posts

28 November 2007 at 2:51am

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

Avatar
Ingo

Forum Moderator, 801 Posts

28 November 2007 at 1:25pm

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

Avatar
superautomatic

Community Member, 53 Posts

28 November 2007 at 10:27pm

Edited: 29/11/2007 6:06am

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?

Avatar
pjssms

Community Member, 49 Posts

25 November 2008 at 7:45am

Is that option available on 2.2.3 ?

How can i use it ?

Avatar
briansohn

Community Member, 5 Posts

11 December 2008 at 9:42pm

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

Avatar
briansohn

Community Member, 5 Posts

12 December 2008 at 6:02am

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