From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA14127; Tue, 30 Apr 2002 03:46:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA14123 for ; Tue, 30 Apr 2002 03:46:16 +0200 (MET DST) Received: from speakeasy.org (shawnw-0.dsl.speakeasy.net [64.81.17.141]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3U1kEf14821 for ; Tue, 30 Apr 2002 03:46:14 +0200 (MET DST) Received: (from shawnw@localhost) by speakeasy.org (8.10.1/8.10.1) id g3U1kuA14607 for caml-list@inria.fr; Mon, 29 Apr 2002 18:46:56 -0700 Date: Mon, 29 Apr 2002 18:46:54 -0700 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] localization Message-ID: <20020429184654.D1213@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <20020429094818.2ebff720.yrashk@telcos.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020429094818.2ebff720.yrashk@telcos.net.ua>; from yrashk@telcos.net.ua on Mon, Apr 29, 2002 at 09:48:18AM +0300 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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