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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2f5274610845c232 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: I18N gettext style Date: 2000/03/04 Message-ID: #1/1 X-Deja-AN: 593001772 References: <89q6pg$9ac1@news.cis.okstate.edu> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 952158481 206.170.2.219 (Sat, 04 Mar 2000 00:28:01 PST) Organization: SBC Internet Services NNTP-Posting-Date: Sat, 04 Mar 2000 00:28:01 PST Newsgroups: comp.lang.ada Date: 2000-03-04T00:00:00+00:00 List-Id: > Ada.Text_IO.Put (N("Hi! There are ") && To_String(I) && N("widgets!")); >won't put I in the proper position in the translated message for some Certainly an Ada version of printf in the form of a set like procedure print0(s : in string); procedure print1(s : in string; a : in string); procedure print2(s : in string; a : in string; b : in string); is easy enough to write. So then you could call print1( N("Hi! There are %s widgets!"), To_String(I)); By always passing in string arguments (using 'image in the simplest case) your Ada routines need only handle %s, not %d or any of the other codes, which is simple and avoids combinatorial explosion. Better yet, instead of %s, use %a in print1, %a and %b in print2, etc, and then N can even change the order, which it can't in the C paradigm.