[Ocaml-i18n] proposal: message catalogue system

sylvain.le-gall at polytechnique.org sylvain.le-gall at polytechnique.org
Thu Dec 4 15:27:18 PST 2003


On Thu, Dec 04, 2003 at 09:22:43AM +0000, Benjamin Geer wrote:
> 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.");
> 

Oops... you are unfortunately right. There is no numbered parameter like
in C. In printf C, you can do %2s %1s to explain which is the parameter
position... But not in caml

> 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?
> 

I begin to read the article. I think you are right... It seems very
interesting. I will try to see how it could be implemented.

Kind regard
Sylvain LE GALL



More information about the Ocaml-i18n mailing list