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.

All other Modules /

Discuss all other Modules here.

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

Default_locale with Sitetree Importer


Go to End


2 Posts   1249 Views

Avatar
lerni

Community Member, 81 Posts

3 December 2009 at 5:10am

hi all

i'm trying to import via Sitetree Importer on a page with translatables enabled. Unfortunately the pages are always created in english and not in the default language.

In _config.php i've set:
Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale('de_CH');
i18n::set_locale('de_CH');
i18n::$common_locales['de_CH'] = array('Deutsch', 'Deutsch (Schweiz)');

Any tips how I manage to get them in the default Language?

Avatar
Kalileo

Community Member, 127 Posts

4 February 2010 at 2:53am

This might be too late for you, lerni, but may be it helps anyone else.

IIRC the Sitetree Importer sets the Title field only (and the parent id). Have a look in it's PHP source code, that part is easy. There, right where it sets the title field, set also the locale field. See the sitetree table(s) for it's exact name. (I write this out of memory only, forgive me for not adding more details)