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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,79c108d8d805d021 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.germany.com!newsfeed2.scan-plus.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada and Internationalization Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1149026932.554318.202570@i39g2000cwa.googlegroups.com> <5zmch4oseolx.1ghtww9ope9bt$.dlg@40tude.net> Date: Thu, 1 Jun 2006 13:00:07 +0200 Message-ID: <1b6kk4c3suwjg.84fral2281gm$.dlg@40tude.net> NNTP-Posting-Date: 01 Jun 2006 12:59:55 MEST NNTP-Posting-Host: 8575d11a.newsread2.arcor-online.net X-Trace: DXC=KMWD;`H87Cm^O_h>VFi7[bQ5U85hF6f;djW\KbG]kaMhVA=iV<7g:2e8k=I=NSeHhkWRXZ37ga[7jjTA67ckJ=XekMWQbmb\jMl X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4636 Date: 2006-06-01T12:59:55+02:00 List-Id: On Wed, 31 May 2006 08:27:38 -0700, James Dennett wrote: > Dmitry A. Kazakov wrote: >> On Wed, 31 May 2006 07:53:36 -0700, James Dennett wrote: >> >>> Dmitry A. Kazakov wrote: >> >>>> I don't see how this is related to internationalization. It looks like >>>> stream communication (see S"Output attribute) or string formatting. In >>>> either case you convert data to/from stream/string. >>> Formatting of strings for human readers needs to produce >>> output that is correctly localized, hence is always an >>> issue in an internationalized program, non? >> >> I am not sure. It looks like a question of content. Formatting is a quite >> low level thing. Mixing content and formatting can turn very surprising. >> There are right-to-left and top-down languages, word ordering might change, >> their number as well, numerals, ordinals, articles, inflexions etc. > > And these are included in my notion of internationalized > formatting, though for a wide range of languages we can > get away with supporting left-to-right, and just dealing > with issues of phrase lookup, word ordering and cardinality. OK, but even then the target cannot be a simple stupid object like stream or string. It should know how to translate a sequence of "precompiled" objects into a proper sentence. There is a danger that it might quickly become double dispatching, the thing we cannot effectively do in Ada. Alternatively the target object should know the language and be intelligent to determine parts of speech... So I'd try to stay as much as possible on the side of objects being output. They should know how to translate themselves according to the target locale. In a recent project I had a similar problem. In place of localization there were different rendering devices: Text, HTML, GTK etc. It ended up with a primitive operation defined on objects, that had a class-wide argument controlling the output parameters. Needless to say, that I am not satisfied with this design. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de