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.

Data Model Questions /

Translatable extension issue


Reply


3 Posts   788 Views

Avatar
Rod

Community Member, 12 Posts

22 August 2011 at 12:21pm

Hi there,

I am building a site which will have en_NZ as the default language, but will have some different content for the UK and AUS versions of the site (and other countries in the future).

I have started this internationalisation process by enabling the Translatable extension by adding the following code to my _config.php:

//add translatable extensions
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');

// Set the site locale
i18n::set_locale('en_NZ');

I THEN saw the warning on this page about setting the appropriate default language for your content BEFORE building the database with Translatable enabled. http://doc.silverstripe.org/sapphire/en/topics/translation

Have I screwed up massively?

In the CMS, the default language for all existing and new pages appears to be 'English (US)', which I don't want as the default.

How can I correct this?

Thanks in advance
Liam

Avatar
Rod

Community Member, 12 Posts

22 August 2011 at 12:45pm

Also, I did have the correct NZ locale set before I added the Translatable extension, I think I just put the extension code in the wrong place.

So my HTML element USED to be:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-NZ" xml:lang="en-NZ">

Since adding the Translatable extension, it is:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

Any help to get all my existing content back to being NZ language would be greatly appreciated!

Avatar
Rod

Community Member, 12 Posts

23 August 2011 at 8:54am

OK, looks like it may be sorted now. I commented out the translatable extension, re-built, and then un-commented it. I also had to create NZ versions of all of my pages one by one (only about 35 pages). But now it seems to be defaulting to NZ at least.

One thing that made it seem worse than it actually was was that I had top-level redirect pages linking to sub pages. When I had created NZ language versions of a section, the redirector wasn't automatically going to the correct child page, it was still linking to the child page of the US version. Something to watch for.