comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: gettext for Ada
Date: Mon, 20 Nov 2017 11:59:23 -0800 (PST)
Date: 2017-11-20T11:59:23-08:00	[thread overview]
Message-ID: <0d02d48a-112f-4817-ab29-6dded00eb81f@googlegroups.com> (raw)
In-Reply-To: <87r2sszr4f.fsf@jacob-sparre.dk>

> > I would actually advise against gettext usage, in general
> 
> I would actually advise in favour of GNU Gettext - or at least it's
> mechanism:
> 
> + The developer can write UI strings which make sense.
> + Translations can be distributed separately from the executables.

Those are the "plus sides" of the technique, but they shouldn't be completely divorced from the "minus sides". (ie we should have realistic/honest evaluations of the proposed solutions to whatever problem we're trying to solve.)

As always, the particular situation may indeed call for something you or I wouldn't normally recommend and, contrawise, pointing out the disadvantages of a proposed solution and/or offering alternatives is often instructive in how to solve the problem.

> 
> The problem with GNU Gettext - and C printf() - is that you lose the
> compile-time checking that formatting fields match the data passed.

Well, that is one of the general problems of formatting strings: they cannot be in-general guaranteed to be correct (at least w/o some really good static analysis).

It's also illustrative of why an actual structured approach to messaging would be much better: simple string-formatting of "You have %d meats." with 1 (one) yields "You have 1 meats." and thereby violates subject-verb agreement (of [non-]plurality). -- The structured approach would take things like this into account, as well as things like plural-forms and casings and construct a sort of "abstract grammar" [or something] which on rendering would yield the appropriate and correct forms for the user. -- Again, I haven't heard of this being used in many projects... but that's probably due to the complex nature of designing the underlying machinery/framework, compared to, say, calling "Copied 1 file(s)." a 'good enough' solution.

  reply	other threads:[~2017-11-20 19:59 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 [this message]
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
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