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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.183.193 with SMTP id h184mr8197099iof.129.1511207964275; Mon, 20 Nov 2017 11:59:24 -0800 (PST) X-Received: by 10.157.1.175 with SMTP id e44mr604046ote.1.1511207964179; Mon, 20 Nov 2017 11:59:24 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.kjsl.com!usenet.stanford.edu!d140no2077715itd.0!news-out.google.com!193ni4170iti.0!nntp.google.com!d140no2077711itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Nov 2017 11:59:23 -0800 (PST) In-Reply-To: <87r2sszr4f.fsf@jacob-sparre.dk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=155.148.6.150; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 155.148.6.150 References: <2c5d0dff-bc12-4b37-b8e1-ac176c3e675f@googlegroups.com> <87r2sszr4f.fsf@jacob-sparre.dk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0d02d48a-112f-4817-ab29-6dded00eb81f@googlegroups.com> Subject: Re: gettext for Ada From: Shark8 Injection-Date: Mon, 20 Nov 2017 19:59:24 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: feeder.eternal-september.org comp.lang.ada:49019 Date: 2017-11-20T11:59:23-08:00 List-Id: > > I would actually advise against gettext usage, in general >=20 > I would actually advise in favour of GNU Gettext - or at least it's > mechanism: >=20 > + 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 complete= ly divorced from the "minus sides". (ie we should have realistic/honest eva= luations of the proposed solutions to whatever problem we're trying to solv= e.) 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 i= n how to solve the problem. >=20 > 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 canno= t be in-general guaranteed to be correct (at least w/o some really good sta= tic analysis). It's also illustrative of why an actual structured approach to messaging wo= uld be much better: simple string-formatting of "You have %d meats." with 1= (one) yields "You have 1 meats." and thereby violates subject-verb agreeme= nt (of [non-]plurality). -- The structured approach would take things like = this into account, as well as things like plural-forms and casings and cons= truct a sort of "abstract grammar" [or something] which on rendering would = yield the appropriate and correct forms for the user. -- Again, I haven't h= eard 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.