"D. Tweed" <[EMAIL PROTECTED]> wrote,

> On Wed, 29 Mar 2000, Matthias Mann wrote:
> 
> > Has anybody some experience on what's the best way to
> > write programs that may interact in multiple languages?
> > 
> Not sure if this is a better idea, but the approach that, from what I can
> gather, a lot of the GNU programs use is equivalent to replacing every
> literal string in the text with roughly
> 
> (lookup language "the string")
> 
> where lookup::Langauge -> String -> String and language is (in C) a global
> variable containing the target language. These strings get looked up at in
> an external set of translations for various languages at runtime (ie once
> for each time the string is called) and if a translation is found it's
> used, otherwise the original string is used. The advantages of this seem
> to be that (1) translators can provide extra translations without needing
> a program recompile and (2) it's failsoft so that if there's no
> translation there's still a string to use, albeit in the language the
> programmer used and (3) with the _(x) macro it doesn't add `visual noise'
> to the program logic.

The GNU package for i18n is gettext:

  http://www.gnu.org/software/gettext/gettext.html

As Fergus already pointed out, the main issue with this is
that it relies on a printf-ish format string to handle
the different word ordering in different languages.

I'd be very interested in ideas on how to address this
problem, because serious application development in Haskell
is significantly hampered without i18n support.  Anything
that could make use of gettext's PO files would of course be 
especially cool, as it can use the existing infrastructure.

Manuel

Reply via email to