comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: gettext for Ada
Date: Tue, 21 Nov 2017 19:10:21 -0600
Date: 2017-11-21T19:10:21-06:00	[thread overview]
Message-ID: <ov2ipt$ig0$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 40dc6a79-9434-4b5a-bed0-50ee1dfb74c5@googlegroups.com

"Shark8" <onewingedshark@gmail.com> wrote in message 
news:40dc6a79-9434-4b5a-bed0-50ee1dfb74c5@googlegroups.com...
> On Monday, November 20, 2017 at 3:43:21 PM UTC-7, Randy Brukardt wrote:
>> "Shark8" wrote in message
>> news:2c5d0dff-bc12-4b37-b8e1-ac176c3e675f...
>> On Sunday, November 19, 2017 at 1:40:55 PM UTC-7, Victor Porton wrote:
>> > Where can I get a gettext bindings for Ada?
>>
>> ...
>> >And then at compile-time select the proper language to build the
>> >application via
>> >GPR-projects, makefiles, or whatever paramaterizable build-system you 
>> >wish
>> >to use.
>>
>> Or, use parallel packages and select the correct one to use at runtime 
>> based
>> on Ada.Locales (A.19). That's the primary purpose of the Locales package,
>> after all.
>
> Parallel packages? I've not heard the term before, how are they used & 
> selected
> at runtime?

I would make a set of parallel child packages with the same operations in 
each. Then one could use an if (or maybe a case, if the proposed Ada 2020 
extension comes to pass) to select them.

Or (perhaps better), use a full OOP design, with an abstract Root_Locale 
type (with a set of dispatching operations), a series of specific Locale 
types (English_Locale, French_Locale, etc.) giving implementations to those 
types, and a map and factory to create objects of those types as needed. 
(The Claw GUI Builder has an internal design much like this, other than the 
factory, which didn't exist in Ada 95, so I had to use a massive case 
statement instead. A factory would have been much better.)

> Also, shouldn't the stuff in Ada.Locales actually be proper
> enumerations rather than strings?

There's a near infinite number of possible Locales, so enumerating them is 
next to impossible. We decided against even giving names to the most common 
ones, as that would have led to endless debates about which ones are the 
most important. The strings come from a freely available ISO standard, so 
they will never change and are easy to find out and are maintained by 
someone other than us Ada people (so no need for debates on our end on 
topics outside of our expertise). This is the same reason that we depend on 
character set standards rather than rolling our own character set rules 
(even though the latter would be easier to maintain, we wouldn't really know 
what we were doing).

                                                 Randy.



  parent reply	other threads:[~2017-11-22  1:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 20:40 gettext for Ada Victor Porton
2017-11-20 15:40 ` Shark8
2017-11-20 19:28   ` Jacob Sparre Andersen
2017-11-20 19:59     ` Shark8
2017-11-20 20:33       ` Dmitry A. Kazakov
2017-11-21 19:15         ` Jacob Sparre Andersen
2017-11-21 20:54           ` Dmitry A. Kazakov
2017-11-23  9:15             ` Jacob Sparre Andersen
2017-11-23  9:47               ` Dmitry A. Kazakov
2017-11-23 10:03                 ` Jacob Sparre Andersen
2017-11-23 10:37                   ` Dmitry A. Kazakov
2017-11-23 12:14                     ` Jacob Sparre Andersen
2017-11-23 13:23                       ` Dmitry A. Kazakov
2017-11-21 19:22       ` Jacob Sparre Andersen
2017-11-20 22:43   ` Randy Brukardt
2017-11-21  0:28     ` Shark8
2017-11-21  8:29       ` G. B.
2017-11-21 13:48         ` J-P. Rosen
2017-11-22  1:10       ` Randy Brukardt [this message]
2017-11-22 15:38         ` Shark8
2017-11-23  0:30           ` Randy Brukardt
2017-11-23  3:08             ` Shark8
2017-11-28  0:48               ` Randy Brukardt
2017-11-28 16:47                 ` Simon Wright
2017-11-28 17:03                 ` Dmitry A. Kazakov
2017-11-28 22:41                   ` Randy Brukardt
2017-11-29  9:09                     ` Dmitry A. Kazakov
2017-11-23  8:25           ` G. B.
2017-11-23 16:02             ` Shark8
2017-11-23 18:55               ` G. B.
2017-11-23 20:24                 ` Shark8
2017-11-28  0:55                   ` Randy Brukardt
2017-11-22 21:36 ` Blady
replies disabled

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