caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Shawn Wagner <shawnw@speakeasy.org>
To: caml-list@inria.fr
Subject: Re: [Caml-list] localization
Date: Mon, 29 Apr 2002 18:46:54 -0700	[thread overview]
Message-ID: <20020429184654.D1213@speakeasy.org> (raw)
In-Reply-To: <20020429094818.2ebff720.yrashk@telcos.net.ua>; from yrashk@telcos.net.ua on Mon, Apr 29, 2002 at 09:48:18AM +0300

On Mon, Apr 29, 2002 at 09:48:18AM +0300, Yurii A.Rashkovskii wrote:
> Guys and gals,
> 

> Is there any standard (or semi-standard) approach for program localization
> in OCaml? (something like gettext, or better) I mean I want to make message
> output in current locale (English, French, Ukranian, Russian and so on :) as
> easy as it is possible.

Here's an idea for an interface to gettext:

Use camlp4 to define a new string literal type (Perhaps using TeX-like
quotes: ``foo''), with one camlp4 module rewriting them into a call to the
translation function for normal compilation, and a second module that is
used to create a .pot file that's used just like one generated from C code
by xgettext. The idea is to make it fairly transparent, and simple to mark
strings that should be translated, without having to clutter up your code
with a lot of things like (Gettext.translate "Something ugly just
happened."). Calling textdomain() or bindtextdomain() would still have to be
done manually (And even that can probably be automated), but otherwise it
should be cleaner than using gettext in C.

-- 
Shawn Wagner
shawnw@speakeasy.org
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2002-04-30  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-29  6:48 Yurii A.Rashkovskii
2002-04-29  7:20 ` Jérôme Marant
2002-04-30  1:46 ` Shawn Wagner [this message]
2002-04-30 10:33   ` John Max Skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020429184654.D1213@speakeasy.org \
    --to=shawnw@speakeasy.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).