[Ocaml-i18n] proposal: message catalogue system

sylvain.le-gall at polytechnique.org sylvain.le-gall at polytechnique.org
Wed Dec 3 11:11:46 PST 2003


Hello,

On Wed, Dec 03, 2003 at 11:13:03AM +0000, Benjamin Geer wrote:
> Another problem with gettext, which I forgot to mention in my last 
> message, is that as far as I can tell, there's no way to use it in a web 
> application, because it can only extract messages from C source code. 
> (And maybe Caml if someone writes a tool to do that.)
> 

Well, no... ;->

You can extract sh, perl, python, ada, C++, java... and ocaml ( since it
is me who has written it ). But for ocaml, it is only a patch i have
produce some times ago against gettext ( i don't submit it to gettext,
because i want to use camlp4 or something like that to extract string ).

There is also PHP... And if you need you can create a tool to handle any
other language...

> I'm writing a web application in which the pages are generated from 
> templates (using CamlTemplate).  I want to write templates that look 
> like this:
> 
> <html>
> <body>
> <p>${msg("please_log_in"})
> 
> <form>
>   ${msg("username")} <input type="text name="username">
>   ${msg("password")} <input type="text name="password">
> </form>
> </body>
> </html>
> 
> It seems that in order to use gettext, I would need a tool that 
> extracted messages from templates and generated .po files.  I really 
> don't want to write such a tool; it would be much easier to write the 
> system I'm proposing.
> 

Regard
Sylvain LE GALL



More information about the Ocaml-i18n mailing list