Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Translatable extension issue

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

Page: 1
Go to End
Author Topic: 773 Views
  • Rod
    Avatar
    Community Member
    12 Posts

    Translatable extension issue Link to this post

    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

  • Rod
    Avatar
    Community Member
    12 Posts

    Re: Translatable extension issue Link to this post

    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" lang="en-NZ">

    Since adding the Translatable extension, it is:

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

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

  • Rod
    Avatar
    Community Member
    12 Posts

    Re: Translatable extension issue Link to this post

    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.

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