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.

General Questions /

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

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

Using Multilingual Content in SilverStripe 2.4


Go to End


2 Posts   2493 Views

Avatar
MarioSommereder

Community Member, 107 Posts

4 October 2010 at 3:04am

I'm trying to add a new translation to an existing site. The version is 2.4.2, so it should be no problem. I read this doc http://doc.silverstripe.org/multilingualcontent, but I'm not getting it running :-(

What I made so far is adding this to mysite/_config.php:

// Set default locale to german / Germany
Translatable::set_default_locale("de_DE");

// Enable multilingual content
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');

After that I did rebuild my database with /dev/build/?flush=1, but nothing changed in the backend.

What did I forget? Thanks for help in advance!

Avatar
swaiba

Forum Moderator, 1899 Posts

4 October 2010 at 4:03am

try having this in your _config.php...

Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale("de_DE");
Translatable::set_allowed_locales(array(
	"de_DE",
	"en_GB"
));

Also this is a nice way to add the flags (to switch languages)...

http://silverstripe.org/general-questions/show/287421?start=0#post287548