comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Ada and Internationalization
Date: Wed, 31 May 2006 12:11:22 +0200
Date: 2006-05-31T12:11:22+02:00	[thread overview]
Message-ID: <1149070281.9173.25.camel@localhost.localdomain> (raw)
In-Reply-To: <1149026932.554318.202570@i39g2000cwa.googlegroups.com>

On Tue, 2006-05-30 at 16:12 -0700, Michael Rohan wrote:
> Hi Folks,
> 
> I've checked Google and have not been able to find anything in Ada out
> there for internationalized code. 

When I do this, I make message printing suitable
for several languages right from the start, taking advantage
of the Ada type system. Collect the messages in an enumeration
type, i.e., name them. Then build an (abstract) Message type around
this enumeration. Then derive (compose) one type for each natural
language.

Advantages:

- Ada's coverage rules will make sure that translation won't
miss a single message.

- You can easily create an external messages collection for the
translators in XML, Excel, plain text, even gettext if you must,
because of the mentioned properties of the message type:
You have it in your program, so just write another main unit
that basically enumerates the values in the types made for
the messages, using the desired output format.

- No need to analyze the entire program using external tools,
no need to touch sources.


Disadvantage:

- It's not gettext, only Ada, so maybe it's less fashionable.

- It also requires that a programmer considers messages important
enough to be worthy of a type that can be checked by the compiler.


Using a Message type and the .properties approach are somewhat
similar, except that with a type, you won't have to leave the Ada
language: add the properties to a library package, e.g. in
constants, roughly:

   (en_US => (got_foo => ...,
              no_bar_please => ...,
              argh => ...),

   (fr_CA => (got_foo => ...,
              no_bar_please => ...,
              arhg => ...),
   ...


Georg 






      parent reply	other threads:[~2006-05-31 10:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30 23:12 Ada and Internationalization Michael Rohan
2006-05-31  5:52 ` Ludovic Brenta
2006-05-31  7:44 ` Dmitry A. Kazakov
2006-05-31 14:53   ` James Dennett
2006-05-31 15:23     ` Dmitry A. Kazakov
2006-05-31 15:27       ` James Dennett
2006-06-01 11:00         ` Dmitry A. Kazakov
2006-06-03  1:23           ` Randy Brukardt
2006-06-04 13:23             ` Stephen Leake
2006-06-04 20:09               ` Randy Brukardt
2006-05-31 10:11 ` Georg Bauhaus [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox