[Ocaml-i18n] proposal: message catalogue system

Benjamin Geer ben at socialtools.net
Thu Dec 4 01:22:43 PST 2003


Benjamin Geer wrote:
>> Well, why do not use en.po ? ( yes you can create a file to translate
>> the own langage string of the program... ).
> 
> Hmm, maybe that could be a good approach.  Of course, you would still 
> have to maintain the catalog as above.

Actually I think it could only be a good approach if there was a tool to 
extract messages from design documents instead of source code.  Some 
organisations might want to plan their user interface (including the 
text) before coding it.  So you'd write a design document saying things 
like: 'When the search is complete, the program will display a message 
saying: _("Your search returned ${a} documents in ${a1} files.").'  You 
could then extract the strings surrounded by _() from that document, and 
generate the message catalog before the programmers had started coding.

If I understand gettext correctly, it seems as if the example sentence 
above shows another problem with gettext: since the programmer still 
uses printf, there's no way for the translator to change the order of 
the numbers, is there?  The programmer writes:

printf ("Your search returned %d documents in %d files.");

What if the translation needs to have a different word order, so that 
the number of files comes first?  Is there a way to do that with gettext?

Ben




More information about the Ocaml-i18n mailing list