[horde] Fwd: Translating

B.J. Black William.Black at Sun.COM
Wed Apr 10 13:45:26 PDT 2002


As someone who just started working with translations, I can definitely 
feel your pain.  My suggestions:

1.  Pick the .po file corresponding to the alternate language you feel 
most comfortable with (the most maintained one will probably always be 
English).
2.  Translate only a few msgstrs at first (for IMP, good ones to pick 
are "To:", "From:", "Subject:", and anything else that you see all the 
time in the program).
3.  Update the headers at the top with information like charset 
(character set is VERY important for some languages, not so much so for 
others--for Japanese one must use UTF-8, SHIFT_JIS, or similar, and they 
can be VERY different from one another).  While I used SHIFT_JIS for my 
project, I recommend UTF-8 if possible (old browsers may not support 
this--IE 3 for one.  Anyone else got an opinion on this?).
4.  Put your .po in the po directory and run make.  Note and fix any 
errors.  For some character sets, you may need a newer version of gettext.
5.  IMPORTANT:  Restart your web server.  Running make only recreates 
the .mo files--gettext caches entries in memory, so you must restart to 
purge them.
6.  Make sure your web browser is configured to accept your language 
first (in preferences on most browsers).
7.  If you've set a preferred language in prefs, change it.
8.  If all else fails, clear your browser cookies and remove /tmp/sess_* 
(this will kill ALL PHP sessions, so don't do this on a live system).
9.  Once you're certain that you're seeing the right .po file contents, 
translate the rest.  It's OK if you leave some untranslated, but it's 
better form to clear those messages (that way, if someone has your 
language and French, e.g., they see half-your-language, half-French, and 
little or no English).  Short version:  If you only do translations for 
half the msgids, delete the other half from your po before releasing.
10.  (At the end 'cause I couldn't think of anywhere else to put it): 
 If you need to change word order in a string that has multiple %s or %d 
arguments, use the positional syntax.  Example:

msgid "The %s bit the %s."
msgstr "The %2$s was bitten by the %1$s."

If the inputs are "dog" and "man", you get:

"The dog bit the man." for msgid and
"The man was bitten by the dog." for msgstr.

This is correct.  If you instead have:

msgid "The %s bit the %s."
msgstr "The %s was bitten by the %s."

With the same inputs, you get:

"The dog bit the man." for msgid and
"The dog was bitten by the man." for msgstr.

Which is wrong.  Obviously, this is English-to-English, but you get the 
idea.  This gets REALLY important when you're talking about numbers, 
because you can't jumble strings and numbers (if we were dealing with C, 
you'd segfault the program--PHP should be a little friendlier and just 
give you unwelcome zeros and whatnot).

Gettext, by the way, is used by TONS of *NIX-like programs (including 
those on Solaris, etc.).  Getting familiar with localizing 
Horde/IMP/Whatever will carry you a long way toward learning generic 
program localization.  It has definitely made me more familiar with the 
issues from a developer's perspective (so that I'll be a little smarter 
about how I write code in the future).

This address is going poof as of Friday (2002-04-12).  If you'd like, 
you can email me at wjblack at yahoo.com for help.
--bj

>
>----- Forwarded message from endy-herinowo <ext2fs at telkom.net> -----
>    Date: Thu, 11 Apr 2002 02:19:48 +0700
>    From: endy-herinowo <ext2fs at telkom.net>
>Reply-To: endy-herinowo <ext2fs at telkom.net>
> Subject: Translating
>      To: consulting at horde.org
>
>
>I m new user on Horde, I want make an Indonesian language
>support for horde in my webmail system, yes I already read
>the README file on the po direktori, but it seem doesn't
>work for me.
>
>I need more information how  to add an language support (if
>possible step-by-step)
>
>thanks
>





More information about the horde mailing list