comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada and Internationalization
Date: Thu, 1 Jun 2006 13:00:07 +0200
Date: 2006-06-01T12:59:55+02:00	[thread overview]
Message-ID: <1b6kk4c3suwjg.84fral2281gm$.dlg@40tude.net> (raw)
In-Reply-To: KBifg.102242$iU2.47585@fed1read01

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



  reply	other threads:[~2006-06-01 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30 23:12 Ada and Internationalization Michael Rohan
2006-05-31  5:52 ` Ludovic Brenta
2006-05-31  7:44 ` Dmitry A. Kazakov
2006-05-31 14:53   ` James Dennett
2006-05-31 15:23     ` Dmitry A. Kazakov
2006-05-31 15:27       ` James Dennett
2006-06-01 11:00         ` Dmitry A. Kazakov [this message]
2006-06-03  1:23           ` Randy Brukardt
2006-06-04 13:23             ` Stephen Leake
2006-06-04 20:09               ` Randy Brukardt
2006-05-31 10:11 ` Georg Bauhaus
replies disabled

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