News module and language bugs (UTF-8)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

News module and language bugs (UTF-8)

Post 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.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

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

Post 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 ;)
Last edited by Hare on Sun Sep 16, 2007 7:19 pm, edited 1 time in total.
Hare
Forum Members
Forum Members
Posts: 87
Joined: Sat Jun 03, 2006 11:46 am

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

Post 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...
Slagar
Forum Members
Forum Members
Posts: 19
Joined: Sat May 10, 2008 11:42 am
Location: Auckland

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

Post by Slagar »

Nice work Hare. Handy indeed.
Could someone add this change to the latest revision/for next release?
olsmondi
New Member
New Member
Posts: 2
Joined: Fri Jun 26, 2009 8:31 pm

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

Post by olsmondi »

It seems this still is relevant. I try to modify the file but seems that it didnt work anymore.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

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

Post by RonnyK »

On what release are you reporting this, and could you describe a test-case if it is on latest....

Ronny
olsmondi
New Member
New Member
Posts: 2
Joined: Fri Jun 26, 2009 8:31 pm

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

Post 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
Attachments
 Mozilla Firefox.png
Last edited by olsmondi on Fri Jun 26, 2009 9:05 pm, edited 1 time in total.
Mats Helge

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

Post 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!
owr_bgld

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

Post 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
Mats Helge

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

Post by Mats Helge »

Well that was fast! Many thanks owr_web for that advice, it did the trick!
Post Reply

Return to “Modules/Add-Ons”