comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: Programming for the World in Ada95
Date: 2000/02/15
Date: 2000-02-15T09:03:06+00:00	[thread overview]
Message-ID: <88b4oa$ljt$1@wanadoo.fr> (raw)
In-Reply-To: 38A83838.44A43A7D@res.raytheon.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]


John J Cupak Jr <John_J_Cupak@res.raytheon.com> a �crit dans le message :
38A83838.44A43A7D@res.raytheon.com...
> Ah, Ada Gurus"
>
> Does anyone have any experiences, thoughts, or comments on how to write
> Ada 95 so that user messages, etc., are EASILY modified for different
> spoken/read languages, as noted in O'Donnel's excellent book,
> "Programming for the World"?
>
> Is there an easy way to specify message strings at load time, or must
> this be done at compile time?
>
Of course, the solution depends on your requirements.
If you just want *messages* in several languages, and accept to have
selection of the language at compile time, here is a useful trick:

declare all your messages as constants in packages, one package per
language, i.e.
package Messages_English is
  -- english constants here
end Messages_English;

package Messages_French is
  -- french constants here
end Messages_French;

Every module then declares:
with Messages;

And you simply declare a library level renaming:
with Messages_English;
package Messages renames Messages_English;

By simply changing "_English" to "_French" in the above two lines, all your
application will switch to French.

For an example of using this technique, see package Debug, available from
Adalog's components page (http://pro.wanadoo.fr/adalog/compo2.htm). Note
that this technique can be extended (to a certain extent) to manage inputs:
You declare the character that means "yes" ('y' or 'o'), etc.

--
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog






  parent reply	other threads:[~2000-02-15  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-14  0:00 Programming for the World in Ada95 John J Cupak Jr
2000-02-14  0:00 ` Gautier
2000-02-14  0:00 ` Ehud Lamm
2000-02-14  0:00 ` Larry Kilgallen
2000-02-16  0:00   ` Robert A Duff
2000-02-15  0:00 ` Jean-Pierre Rosen [this message]
2000-02-15  0:00   ` Marin D. Condic
2000-02-15  0:00     ` Ray Blaak
2000-02-16  0:00       ` Pascal Obry
2000-02-16  0:00       ` Larry Kilgallen
2000-02-16  0:00       ` Nick Roberts
2000-02-16  0:00       ` Pascal Obry
2000-02-16  0:00         ` Ray Blaak
replies disabled

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