From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ec7fc30600a974ce X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Programming for the World in Ada95 Date: 2000/02/15 Message-ID: <88b4oa$ljt$1@wanadoo.fr>#1/1 X-Deja-AN: 586039328 References: <38A83838.44A43A7D@res.raytheon.com> X-Priority: 3 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 950605386 22141 164.138.135.246 (15 Feb 2000 09:03:06 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 15 Feb 2000 09:03:06 GMT Newsgroups: comp.lang.ada Date: 2000-02-15T09:03:06+00:00 List-Id: John J Cupak Jr 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