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: "Pascal Obry" Subject: Re: Programming for the World in Ada95 Date: 2000/02/16 Message-ID: <88esvl$nlb$1@wanadoo.fr>#1/1 X-Deja-AN: 586633511 References: <38A83838.44A43A7D@res.raytheon.com> <88b4oa$ljt$1@wanadoo.fr> <38A99E37.F355452C@quadruscorp.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 950728501 24235 193.250.167.160 (16 Feb 2000 19:15:01 GMT) Organization: home NNTP-Posting-Date: 16 Feb 2000 19:15:01 GMT Newsgroups: comp.lang.ada Date: 2000-02-16T19:15:01+00:00 List-Id: Ray Blaak a �crit dans le message ... >"${critical_count} critical things are in the ${total_count} bad things here" > >The upshot is that the messages package now needs to allow the specification of >values for the placeholders, using name/value pairs: > > type Replacement is private: > type Replacements is array (<>) of Replacement; > > function Subst(Name, Value : in String) return Replacement; > > function Translate > (message : in Translatable_Message; parameters : in Replacements) > return String; > -- I prefer Translate or Lookup instead of Display_Message, since you might > -- need the translated string for many purposes, e.g. logging, error > -- messages, on a button, in a menu, etc. I also suggest > -- Translatable_Message or something similar, since the text is not > -- necessarily for errors. A function very close to this one could be found in my Template_Parser package. Nice plug isn't it :) I use it all the time to parse Web page template containing tags to be replaced by some values before sending it back to the Web server. Pascal. --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://perso.wanadoo.fr/pascal.obry --| --| "The best way to travel is by means of imagination"