Thanks for that. I'm really bad with i18n stuff, so if anyone has some code to contribute, I'll ratify it and check it in. Being in the US, as ashamed as I am to say it, I rarely have to deal with this stuff, so I've never really gotten the exposure to it. I'd love for my modules to be as accessible as possible, though, so please lend a hand if you can.
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.
- Previous 10 entries
- 1
- Page 22(current)
If I can solve it myself I'll contribute. :)
@alexanm how you solved the problem? Seems to work on your site?
Btw. the widgets on the homepage are selfmade?
The problem is, that i18n::set_locale(); does not call setlocale, so functions like strftime don't know that the locale has changed.
The simplest fix for this is to call setlocale after calling i18n::set_locale().
Example: mysite/_config.php
i18n::set_locale('de_DE');
setlocale(LC_TIME, 'de_DE.UTF8') //for a linux/unix server.
You can also use LC_ALL to set the other locale relevant things as well, see the php documentation for setlocale.
IMHO this behaviour should be changed in sapphire/core/i18n.php, so that set_locale includes this call to setlocale():
static function set_locale($locale) {
if ($locale){
self::$current_locale = $locale;
setlocale(LC_ALL, $locale);
}
I had a similar problem: Translation in the CMS Backend worked, but dates and times (only from event_calendar!) where shown in english instead of german.
Hack:
put the following line into CalendarUtil.php function i18n_date so that it looks like this:
public static function i18n_date($char, $ts)
{
setlocale(LC_ALL, i18n::get_locale());
return strftime($char,$ts);
}
Seems like php forgets the locale. Setting locale in _config did not work for me :-(
Hello all!
I have managed to set the EventCalendar to German. All works fine except the one special character in the monthNav (March = März) it does show the "ä" in the headline of the description page but why not in the calendar widget monthNAV? Any idea how I can fix that?
kind regards
PS: included a screenshot
- Previous 10 entries
- 1
- Page 22(current)