633 Posts in 170 Topics by 237 members
| Go to End | Next > | |
| Author | Topic: | 2555 Views |
-
Widget with MultiLanguage content

2 March 2010 at 2:48am
Hello.
I have been trying to make multi language widget. The problem is that, when I choose another language (not English) widget doesn't get data according this language.
Index page (where I added widget) getting new locale after language switch, but widget not. If I am right widget doesn't have locale field at all.
How can I get site locale in widget? Any suggestions?
Thank you a lot
-
Re: Widget with MultiLanguage content

11 June 2010 at 6:21am
This most likely occured when
1. Create page in language A
2. 'Duplicate' page in language B by means of the 'Translations' tabIn this case the same WidgetAreaID is used for two different pages. Solution I found is to alter the database (create new row in WidgetArea table and change SidebarID in Page table).
Happend to me on SS2.3.7
-
Re: Widget with MultiLanguage content

28 August 2010 at 3:15am
The problem is already in 2.4, any solutions? Or where is the function to create the new translated page? There we only need to add the creation handler for widget areas...
-
Re: Widget with MultiLanguage content

20 September 2010 at 9:26pm
OK, I haven't activated 'Translatable' for widgets...
Object::add_extension('Widget', 'Translatable');
Object::add_extension('WidgetArea', 'Translatable');But there is also a bug because when adding a widget now, it will be created for 'en_US' instead of the current language
Here is my config:Translatable::enable();
Translatable::set_default_lang('de_DE');
Translatable::set_default_locale('de_DE');// Set the site locale
i18n::enable();
//i18n::set_locale('de_DE');
i18n::set_default_lang('de_DE');
i18n::get_tinymce_lang('de_DE');I have german (de_DE) and english (en_GB!) pages and there are no problems by switching the language, only the widget areas doesn't work probably. Pages will be save in their language and widgets as Locale = 'en_US'?! Because of that I can't see the added widgets in the backend.
-
Re: Widget with MultiLanguage content

29 October 2010 at 7:55pm Last edited: 29 October 2010 9:25pm
OK I have it by adding simple auto correction on before saving a widget
in sapphire/widgets/Widget.phpfunction onBeforeWrite() {
parent::onBeforeWrite();
// Set locale from the currently choosen language locale
if($this->Locale != Translatable::get_current_locale()) {
$this->Locale = Translatable::get_current_locale();
}
} -
Re: Widget with MultiLanguage content

24 February 2011 at 5:27am
I've opened a ticket to address this issue. http://open.silverstripe.org/ticket/6470
-
Re: Widget with MultiLanguage content

29 April 2011 at 10:59pm
Hey, nothing happened for this bug, but in my opinion the multilingual functionallity is very important for a CMS...
Does anyone know, when it will be fixed?
| 2555 Views | ||
| Go to Top | Next > |



