[Ocaml-i18n] proposal: message catalogue system

Richard Jones rich at annexia.org
Fri Dec 5 06:04:24 PST 2003


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.)
> 
> 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.

The trick (which we used on the aforementioned large Perl project) was
to have separate HTML templates for each language.

The translators actually had pretty advanced tools which would keep
the HTML templates in synch with each other. I think they generated
the .html.fr, .html.it etc. from the "source" .html.en file. I was
quite impressed, particularly since they were doing all this on
Windows :-)

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