[Ocaml-i18n] proposal: message catalogue system

sylvain.le-gall at polytechnique.org sylvain.le-gall at polytechnique.org
Tue Dec 2 22:59:40 PST 2003


Hello,

On Tue, Dec 02, 2003 at 11:29:43PM +0000, Benjamin Geer wrote:
> Sylvain LE GALL wrote:
> >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.
> 
> The program can always have a default language, so if a translation for 
> a key doesn't exist, it can use the equivalent text in the default 
> language.  This has worked fine on projects I've worked on.  It's also 
> what gettext does, isn't it?  If you use symbolic keys, the only 
> difference is that the text for the default language isn't in the source 
> code; it's in a separate file.
> 
> Program text is often written by usability specialists or marketing 
> people, not by programmers.  Having text in files that those people can 
> edit is an advantage, isn't it?
> 

But in gettext, you have also separate file for translation ! I think it
is .po ( and .POT ) files. You have only one langage in the source code
( or symbolic name ). 

> Still, there's nothing in my proposal to stop you from using the 
> original sentence as a key; as far as the message catalogue facility is 
> concerned, keys are just strings.
> 
> >- 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...
> 
> Using strings as keys is exactly what I proposed, but why not use 
> meaningful keys ("files_in_directories") instead of arbitrary ones 
> ("KEY_1")?
> 

Off course, it was just an example, but it is also a problem. I always
recommend to keep the relevant source the nearer of the source code. Ie
there should be at least a default case which means something and is
human readable, for programmer sake and users sake. I have seen many
programs which display COLUMN_TEXT in the first column of a text,
because it cannot find his own catalog...

> >- 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 think it's unwise to say that something is inefficient before you've 
> tested it.  It only needs to be efficient *enough*.  And have you looked 
> at the code that a translator has to write in order to handle complex 
> plurals in gettext?  Here's an example for Slavic languages, taken from 
> the gettext manual:
> 

Sorry, it was just to create a reaction. 

> Plural-Forms: nplurals=3; \
>   plural=n%10==1 && n%100!=11 ? 0 : \
>     n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
> 
> Complexity is inherent in the problem, because languages are complex. 
> However, I think the syntax above is horrible, and I think the syntax I 
> proposed would be much easier for a translator to handle.
> 

Well, as i understand, there is a very complex form for slavic
languages. I don't think gettext is perfect, but i think it efficient,
ie it tries to solve most of the translation problem. 

> >I recommend to use gettext. I think it is the most powerful tool for
> >translation. You can extract text...
> 
> Did you read the article I was discussing?  I think it makes a pretty 
> strong case that gettext is inadequate.  Here's the link again:
> 
> http://www.icewalkers.com/Perl/5.8.0/lib/Locale/Maketext/TPJ13.html
> 
> Ben
> 

Right now, i have no time for this... I promise to have a look at it
tonight.

Kind regard
Sylvain LE GALL



More information about the Ocaml-i18n mailing list