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.

General Questions /

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

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

Multilanguage / Batch Action Problem


Reply


633 Views

Avatar
Silver2010

Community Member, 5 Posts

3 December 2010 at 3:40am

Dear Members,

I'd like to ask you for my following problems with Version 2.4.2. I need for my new project multilanguage. I read many topics for this problem. But I don't think I have the right solution for that.

I need to languages german and english us. I copied this code in my _config.php:

// add multilanguage Support
i18n::set_locale('de_DE');
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable'); // 2.4 or newer only
Translatable::set_default_locale('de_DE');

In my Page.php I wrote:
   
public function init() {
      parent::init();
       if($this->dataRecord->hasExtension('Translatable')){
i18n::set_locale($this->dataRecord->Locale);
}
The main problem is that I don't understand what is the correct code for my version 2.4.2.

A bIg problem is: I have the menu with languages in the backend but if do /dev/build with the database. I get in my english us profile a new category. I don't understand that? I tryed to delete that not necessary categories with batch action - I can't delete them only in the german profile?

Is there any tip for that problem or a better solution with multilanguage???

Thanks for the help!

      

Attached Files