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.

Customising the CMS /

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

How do I localize a whole site at once?


Go to End


3 Posts   2324 Views

Avatar
SilverRay

Community Member, 167 Posts

12 April 2011 at 9:53pm

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.

Avatar
Ingo

Forum Moderator, 801 Posts

17 April 2011 at 10:53pm

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 :)

Avatar
SilverRay

Community Member, 167 Posts

20 April 2011 at 7:57pm

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

Thanks!