[Ocaml-i18n] proposal: message catalogue system

Richard Jones rich at annexia.org
Fri Dec 5 05:57:20 PST 2003


On Wed, Dec 03, 2003 at 12:00:08AM +0100, Sylvain LE GALL wrote:
> Hello,
> 
> Well, i won't quote your whole message. So i just give some idea : 
> - using a text key which is the original sentence which need to be
>   translated is GOOD. Because most of the time translation is a feature
>   not the key of the program. So it should not be blocking for the rest
>   of the APP ( ie if a single translation doesn't not exist, it must not
>   issue an arbitrary key, nor raise an exception.
> - if you really want to use anything else as a key, why don't you use
>   "KEY_1" as a key ( ie string as key ). I think it is not good but...
> - question of notation is hard... 
> - using more than one function ( or brackets or anything else ) is
>   getting inefficient when you have already complex function ( ie i
>   don't think anyone want to have a big source code just because of
>   translation ).
> 
> I recommend to use gettext. I think it is the most powerful tool for
> translation. You can extract text...

I fully agree with these recommendations.

On one very large website that I worked on (in Perl), we translated
the whole site using just gettext into 7 languages (including Thai and
Arabic [right-to-left]).

It turns out that whole singular/plural issue can be worked around
fairly easily. For example, we would write something like:

	Number of messages in your inbox:		10

instead of:

	You have 10 messages in your inbox.

Using 'gettext' inline, and using standard xgettext to extract the
messages made it very easy for the programmers, and meant that every
last part of the application didn't have to be translated and kept up
to date all at once.

Conversely, I also worked on a Java project where they had rolled
their own translation system using keys into an external XML
file. That was a really bad approach, because the application kept
crashing every time a translation was missing.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
'There is a joke about American engineers and French engineers. The
American team brings a prototype to the French team. The French team's
response is: "Well, it works fine in practice; but how will it hold up
in theory?"'



More information about the Ocaml-i18n mailing list