Problem with German "March" in multilingual blog

Found a bug? Tell us!!
Post Reply
lillebror
Regular
Posts: 7
Joined: Fri Jan 12, 2007 1:27 am

Problem with German "March" in multilingual blog

Post by lillebror »

Hey everybody!

As some others here, I have the problem with showing the calendar month March (in German März) in the right format. Instead, I get "März". I have a two-language-blog, in German and Swedish, and because Swedish weekdays wasn't shown correctly either, I changed the following in /include/functions.inc.php:

Code: Select all

function serendipity_strftime($format, $timestamp = null, $useOffset = true) {
    global $serendipity;
    static $is_win_utf = null;
into

Code: Select all

function serendipity_strftime($format, $timestamp = null, $useOffset = true) {
    global $serendipity;
    static $is_win_utf = true;
This, I've read in another forum thread here, and it worked, but only for Swedish dates. I still don't get the German umlauts to work. Does anybody have a solution?

Lillebror
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with German "March" in multilingual bl

Post by garvinhicking »

Hi!

The proper solution would be to install de_DE locales on your server.

Serendipity uses the locale system of the server to print localized dates. Search this forum for "locale" for more information.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lillebror
Regular
Posts: 7
Joined: Fri Jan 12, 2007 1:27 am

Post by lillebror »

The problem is, if I let the option above, the Swedish Dates (with å letters) seem to be correct. If I set the option strftime back to "null", the German "März" is correct, but no longer the Swedish ones. I don't understand that really.

I do not own my own server, so I must ask my hoster. You said, they have to install the de_DE locale, or what? How must the option strftime then to be set, as null or true?

Lillebror
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, that's the reason why you should not patch the s9y code, but instead install the de_DE locales (de_DE.UTF8, de_DE.ISO8859-1).
I do not own my own server, so I must ask my hoster. You said, they have to install the de_DE locale, or what? How must the option strftime then to be set, as null or true?
Just reset the changes you made to the file to the original file. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gimmel
Regular
Posts: 118
Joined: Tue Jul 25, 2006 2:44 pm
Location: Quickborn/Germany
Contact:

Post by gimmel »

Some hosters are not able to install the proper UTF locales (like my hoster Manitu).
So I changed every Smarty variable in every .tpl to convert the ä-Umlaut. (Since there are no other umlauts in german month names.)

Example:
Change
{$head_subtitle}
to
{$head_subtitle|regex_replace:"/\xE4/":"ä"}

That's no fun, I know. The other solution is to switch to another hoster which is able to install locales. (Or to have your blog running with ISO8859. But who really wants that…?)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Really, why is Manitu not able to do that? That's strange, I figured them to be a really good hosting company...?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gimmel
Regular
Posts: 118
Joined: Tue Jul 25, 2006 2:44 pm
Location: Quickborn/Germany
Contact:

Post by gimmel »

Mostly they are really good. But the locales thing was no fun. I had to explain them what locales are and how to show the installed locales (locale -a). They only have de_DE installed.
After asking them to install the missing locales de_DE.ISO8859-1, de_DE.ISO8859-15 and de_DE.UTF-8, Manuel answered:
„Wir schauen, was wir tun können (es ist aber nicht immer so einfach, wie es auf einem Home-Server wäre - wir reden hier über ca. 250 Fragen und Aspekte aus einem Sicherheitskatalog, die es zu beachten gibt).“

This happened in March (as you could guess) an there is no UTF locale 'til today as you can see here.

I'm working with many hosters and all of them have UTF-8 locales except for manitu. I don't understand that either. Disappointing…
Post Reply