Korean language file, ISO-8859-1 issue

Discussion corner for Developers of Serendipity.
Post Reply
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Korean language file, ISO-8859-1 issue

Post by wesley »

I was looking at Korean language file for s9y and... it's virtually devoid of translation. It looks like it was translated very early on the development and the translators (there were two?!) never bothered to check back.

This is quite disturbing as I was considering a bilingual blog setup. Well, you know what? Maybe I'll translate this from scratch. Don't take my word, for it, though. I tend to procrastinate a lot.

Oh, and btw, English language encoding defaulting to ISO-8859-1 doesn't bode very well for me. This corrupts any non-English-language-that-does-not-use-western-alphabet entries and I think the English language file should either have UTF-8 encoding as the default or have an UTF-8 option for English for compatibility. For the time being I've changed LANG_CHARSET in serendipity_land_en.inc.php to UTF-8 from ISO-8859-1 as a workaround. I'd like to hear what the s9y developers think of this issue.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Korean language file, ISO-8859-1 issue

Post by garvinhicking »

Your contribution would be most welcome. Sadly I don't know korean. :-D

And we are working on pondering how to solve the UTF-8 issue. The problem is for long-time s9y users they can not just switch from ISO to UTF-8 as then every entry would be wrong. So we would need a one-time convert of ALL files and ALL entries, but this is very hard to do.

Changing the LANG_CHARSET in the korean file is perfectly fine for the time being (also in english file if you prefer).

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

I'm through about 1/4 of the file and I'm noticing that a lot of the dates are fixed to 'month-year' designation. Koreans use 'year-month' designation at all times and it looks weird even after localization. Specifically, it's '(year number)nyeon (month number)wol', so there's some extra strings involved. There needs to be more flexibility.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Of which string(s)/constants are you speaking of specifically?

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Okay, the Korean localization is 100% complete. Wow... okay. Let's see.

Problems with the date printing that I noticed which are not controllable:
(Korean text transliterated and enclosed in {})

Calendar sidebar plugin - always in Month-Year order. Korean language setting shows this as 7{wol} '05 right now. It should be possible to show it as '05{nyeon} 7{wol}.

Archives - browsing by month, by topics shows both the top box and the title showing in Month-Year order. Korean language setting shows this as 7{wol} 2005. It should be possible to show it as 2005{nyeon} 7{wol}.

One more thing... right below the comments box, we have this:
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
There does not seem to be any localization string that enables me to replace this text to Korean version.

I will have the Korean localization file uploaded after doing another check.

EDIT: Please visit my blog (link at the bottom) to download the file. Thank you.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Ah, okay now I see what you mean. In fact this would require a specific korean template for entries.tpl and plugin_calendar.tpl as it is harder to abstract specific for a language.

The text below the comments box can be found in the various plugin files (/plugins/serendipity_event_s9ymarkup/) with its own language fules.
# 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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Thanks for pointing that out for me! I've got the Korean localizations for those as well now.

This blog entry at my site now has link to the Korean language file as well as the additional Korean localization files that I made. Please take a look.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Could you provide diffs/patch files against our recent 0.9 SVN snapshot version? Then I could commit your changes to serendipity! :)

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

0.90 SVN relevant files

The uploaded file contains the Korean language files relevant to the 0.90 SVN trunk.

The main language file is completely different from the one in the SVN, line by line, because I've done the translation from scratch. See diff.txt for the diff output. This one has been updated to contain 100% of the strings present in the current English language file and should be good.

The plugins language files are new ones, so there is no diff and simply needs to be merged to the trunk.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Wesley, thanks a lot for your very fast work! I took the liberty to commit your files to our repository! :-)

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Alright, that's great. :)
Okay, moving onto the other plugins which are not part of the trunk...

Plugins I modified

Checking with the SourceForge CVS, It seems all plugins involved had you as the author, so this might be easier than I initially thought.

Each folder has several files in there... I think it's easy to be verbose than doing diff (it doesn't quite seem to work as nice on my rig).

Files ending with 'copy' are the untouched versions I kept around in case I messed it up. These can be found in folders that have modified php file. This is not of interest.

All folders should have lang_ko.inc.php for Korean localization. None of the plugins had this before, so these are 'fresh meat'. The NOTES file in the folder indicated this as 'Korean localization added'.

Then we have 'Multilingual function added' in NOTES in some folders. This merely means the original file got this added into the code right after the first line:
// Probe for a language include with constants. Still include defines later on, if some constants were missing
$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
Any codes after that are exactly the same unless I made another comment in NOTES. That code was needed to have lang_ko.inc.php loading and I was a bit surprised some of the plugins had this missing.

Okay, here's the explanation for the 'another comment in NOTES' part.

event_entrypaging:
Changed ORDER BY from 'e.id' to 'e.timestamp' (bug fix)

See line 94 of the modified file (unmodified at 88). The original implementation had e.id for ORDER BY. I had this changed to e.timestamp.

In my blog, posts are not necessarily chronologically ordered, e.g. post #100 has much earlier timestamp (2001-12-09) than post #1 (2005-07-06). This is because I've imported all my old articles to the blog after setting it up. Apparently, with 'e.id' what happens is that ALL the posts with timestamp earlier than #1 has the 'Next' post showing up as post #1. I was quite baffled. 'Previous' post has always been fetched correctly.

I practically never touch PHP (only codes in VC++ and VB) but I could get the general sense of the flow of the code, and had an idea of 'what if it's ordered by timestamp? ordering by id then picking only the first one might be the reason why it caused the problem for me'. So I replaced 'e.id' with 'e.timestamp'.

Well, it works quite well for me now. The 'Next' post is fetched correctly, and 'Previous' post still works fine as well. I've checked the functionality with all the posts in my blog to make sure of this.

So I think, unless there's some other problem I haven't yet come across, this modification should be made into the official code.

plugin_multilingual:
Added -10px bottom margin to remove blank line

See line 80 and 92 of the modified file. I put a div tag that does margin-bottom: -10px. Purely cosmetic, but I didn't like that the dropdown box had too much whitespace below it in some browsers. This seems to be more or less of a good fix for me (tested the looks in IE & FireFox in Windows, Safari & Camino in Mac).


Sooo... what do you think?

P.S. modified files have been saved in UTF-8 format.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hey wesley, thanks again!

There are a couple of things to note though:

1. It would be easier if you used the plugin structure of our CVS; for example you put the serendipity_event_staticpage and serendipity_plugin_staticpage into two different directories, while in fact they are in the same directory. This was not a real problem, only a hassle for me ot copy files over. :)

2. Saving the plugin files as UTF-8 introduces problems because some of the files contain ISO-8859-1 special characters (like german umlauts) which were destroyed by that change. Saving the lang_ko in UTF-8 though is required and well.

3. I did not commit the NOTES files because they are currently not that really needed for only language changes. However the idea is good to document changes in that file in the future, but then maybe call it ChangeLog.

4. The bug you fixed about the timestamp ordering is perfectly well, thanks a lot! In fact this solves a problem for a user here on this forums. :-)

5. You added a -10px bottom margin for fixing the look on your site. However I suggest you do that with CSS in your template instead. There are a couple of templates where a -10px margin would break things ugly, so we should not hardcode those styles. The better way to style it would be to use this CSS in your style.css of your template:

Code: Select all

.container_serendipity_plugin_multilingual form {
  margin: -10px;
}
Many thanks for your work! Now that you know about those other minor things, would you like to get a CVS account so you can maintain other plugin's languages? And/Or a SVN account to maintain the core language?
If yes, I just need your SourceForge.Net and BerliOS usernames. :)

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Alrighty! I'll use ISO-8859-1 to save the main plugin file next time I do that.
I'll have the styles incorporated in my template as you mentioned.

Sounds like a good plan to have the access. I'd be happy to participate.

SourceForge: wesley96
BerliOS: wesley

Thanks!
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Alright, I've added you to SVN/BerliOS already. SourceForge seems to be down right now so I'll do that later. If I forgot about that, please drop me a note :-D

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/
Post Reply