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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Translatable: Only displays duplicate page of current language


Reply


4 Posts   1264 Views

Avatar
AlaVive

Community Member, 42 Posts

23 February 2010 at 12:10pm

Using 2.3.3, with English as the default language, I've been trying to add multilingual capabilities to an existing site. But I'm not sure I'm doing it correctly.

I've followed all the instructions at http://doc.silverstripe.org/doku.php?id=multilingualcontent to enable translatable-- at least, as far as I understand to do so. I see the alternative language site tree drop down in my CMS and the "Translations" tab. However, when I select to create a translation of the page (Portuguese/Brazil [pt_BR]), the page it creates is still in English.

Is this the way it's supposed to be? Based on the information and images I'm seeing in the tutorial, it appears things are translated automatically.

I feel a bit stupid for asking, but I just need to be sure how much of this is misunderstanding and how much is user error.

In my mysite/config:

Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale('en_US');
Translatable::set_allowed_locales(array(
'en_US',
'pt_BR'
)
);

I suspect I'm supposed to do something more, but I'm a complete novice in this department. I was lost in the "usage" section of the documentation. So, what are the next steps?

Avatar
AlaVive

Community Member, 42 Posts

3 March 2010 at 9:36am

Hello, Anyone Who Can Help.

Just telling me what I should expect from Translatable would be a great start.

What is written in the documentation about appending the lang/extension to the page url is true. It's doing that.

However, unlike what I understand of the documentation, it ALSO adds a number to the page version (as in, "about-us-2/?stage=Stage&locale=pt_BR").

For starters, is this right? Or, is it an indication of something being WRONG?

Avatar
Juanitou

Community Member, 323 Posts

3 March 2010 at 10:49am

Edited: 03/03/2010 10:50am

Hi!

With Translatable you can have per-language site trees with translated pages linked to the default language ones (or not, if I remember well).

When creating a translation of a page, SS automatically adds a number to the URL, as they are unique, expecting YOU to change it to “sobre-nos”, for example…

And for automatically generated translations, you should be kidding!

Hope it helps,
Juan

Avatar
AlaVive

Community Member, 42 Posts

4 March 2010 at 7:57am

Thanks much, Juanitou!

I thought that had to be the case, but I've grown accustomed to being amazed by what Silverstripe can do--so I thought I'd be open to being impressed even further ;-).

I've also grown accustomed to the habit of sabotaging perfectly good CMS functionality with minor typos or my misunderstanding of the documentation. Fortunately, you saved me some time by clarifying that it was the latter!