Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » How do I localize a whole site at once?

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

Page: 1
Go to End
Author Topic: 1243 Views
  • SilverRay
    Avatar
    Community Member
    167 Posts

    How do I localize a whole site at once? Link to this post

    It seems when I want to add a language to a site, it is per page only. For instance, when I want to add German as a language, I prepare the site as per http://doc.silverstripe.org/sapphire/en/topics/translation and add to my config file:

    Translatable::set_allowed_locales(array(
    'en_US',
    'de_DE
    )
    );

    This works: when I add a language to the home page via the Translations tab, I can make a German page appear. But when I look at the page in a browser, all navigation is gone, because all other pages in the site didn't have any language added yet. Is there a way to make all pages accessible in the site, even when no other languages are added to these pages? In other words, I would be able to navigate through the site and see the default English pages when no other language has been added to the respective pages? Or do I have to add a language to every page manually in order to make them visible?

    Thanks,
    - Ray.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: How do I localize a whole site at once? Link to this post

    Thats not possible with existing code, although it'll be fairly easy to write a task for that.
    See MigrateTranslatableTask.php to get you started

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: How do I localize a whole site at once? Link to this post

    OK, I'll have a look. Guess I'm spoiled by things like Cocoa frameworks...

    Thanks!

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