Page 1 of 1

News module and language bugs (UTF-8)

Posted: Sun Jul 15, 2007 3:14 pm
by Hare
Could someone kindly tell me how to hack the news module to give working UTF-8 month names.

Many people have complained about this and people have filed bugs in the module forge. It hasn't been fixed despite the fact that the problem has existed for a long time (a year or more?). There are bug reports from 2006 in the forge. I can't imagine it's that hard to fix.

The problem is that month localizations in the news editor look like this "kes?kuu" when it should be "kesäkuu". That was an example using Finnish. Plenty of other languages are also affected.

I've spent quite a while trying to figure out the guts of the news module but I can't find a way to fix this. Could someone kindly help fix this. This is very annoying to the user but should be pretty trivial to fix.

Re: News module and language bugs (UTF-8)

Posted: Sun Jul 15, 2007 3:37 pm
by Hare
FIXED

I guess the problem wasn't with the news module itself.

Here's what I did. Open lib/smarty/internals/function.html_select_date.php

Change the line:

Code: Select all

$month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
to

Code: Select all

$month_names[$i] = utf8_encode(strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)));
That fixes the problem. What previously happened was that the month name was in ISO-889... when the page itself was in UTF-8 causing the letter problems.

Thank you Hare, you rock ;)

Re: News module and language bugs (UTF-8)

Posted: Sun Sep 28, 2008 1:11 pm
by Hare
I just thought I'd bump this message because this thing is trivial to fix but may cause serious headache to people who need umlaut characters in the news module admin interface... I just installed 1.4.1 and noticed that this wasn't fixed...

Re: News module and language bugs (UTF-8)

Posted: Mon Sep 29, 2008 4:29 am
by Slagar
Nice work Hare. Handy indeed.
Could someone add this change to the latest revision/for next release?

Re: News module and language bugs (UTF-8)

Posted: Fri Jun 26, 2009 8:37 pm
by olsmondi
It seems this still is relevant. I try to modify the file but seems that it didnt work anymore.

Re: News module and language bugs (UTF-8)

Posted: Fri Jun 26, 2009 8:43 pm
by RonnyK
On what release are you reporting this, and could you describe a test-case if it is on latest....

Ronny

Re: News module and language bugs (UTF-8)

Posted: Fri Jun 26, 2009 8:51 pm
by olsmondi
Ouh sorry. Im pretty new with this.
The month in news module is corrupted with language Finnish. 

CMS Version
1.6

I did a "default" install from shell.
Changed default language for the frontend to Suomi|Finnish.
Also tried to modify that function.html_select_date.php file under lib/smarty/plugins.
Attached picture what Im meaning. It should be kesä or kesäkuu

Re: News module and language bugs (UTF-8)

Posted: Thu May 06, 2010 5:28 am
by Mats Helge
Posting to revitalize this thread, which I see important:

I'm having same problem as olsmondi, or atleast I think I am.

I'm running on v.1.7 and my news shows date like this (frontend on Finnish)

Image

So where does the strange mark come from? This screencapture is from firefox, IE and Opera show a different symbol.

Thanks guys!

Re: News module and language bugs (UTF-8)

Posted: Thu May 06, 2010 6:55 am
by owr_bgld
I don't think that it's need to change the php-file - this should fix the problem:

in the config php you can find this (in my example it's for german) at Locale/encoding Settings:

Code: Select all

$config['locale'] = 'de_DE';
change the line to

Code: Select all

$config['locale'] = 'de_DE.UTF8';
you have to put ".UTF8" behind the language

Re: News module and language bugs (UTF-8)

Posted: Thu May 06, 2010 12:04 pm
by Mats Helge
Well that was fast! Many thanks owr_web for that advice, it did the trick!