From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12140 Path: news.gmane.org!.POSTED!not-for-mail From: "A. Wilcox" Newsgroups: gmane.linux.lib.musl.general Subject: Re: Bikeshed invitation for nl_langinfo ambiguities Date: Sun, 26 Nov 2017 20:57:25 -0600 Organization: =?UTF-8?Q?Ad=c3=a9lie_Linux?= Message-ID: <5A1B7F15.4050808@adelielinux.org> References: <20171111020612.GV1627@brightrain.aerifal.cx> <5A1B4BEB.5030304@adelielinux.org> <20171127010700.GW1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1511751469 29463 195.159.176.226 (27 Nov 2017 02:57:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Nov 2017 02:57:49 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 To: musl@lists.openwall.com Original-X-From: musl-return-12156-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 27 03:57:44 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eJ9c0-0006lq-Sb for gllmg-musl@m.gmane.org; Mon, 27 Nov 2017 03:57:36 +0100 Original-Received: (qmail 11704 invoked by uid 550); 27 Nov 2017 02:57:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11686 invoked from network); 27 Nov 2017 02:57:41 -0000 In-Reply-To: <20171127010700.GW1627@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12140 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 26/11/17 19:07, Rich Felker wrote: >> I would personally recommend actually using the enum values as >> the strings to translate. _("MON_5"), _("ABMON_5"), etc; this >> is non-ambiguous, easily understandable and describable for >> translators, and does not require weird hacks at the >> implementation or ABI level. > > This is certainly one possibility, but it does result in embedding > a number of "useless" strings that are never used themselves, only > as translation keys, in the binary. One nice property of it > (especially if we did the same for strerror keys) is that it > eliminates the need for translation files to care about changes in > the text in musl. That was the idea, yes. This would work for *all* translatable strings, not just the nl_langinfo ones. >> Of course, then a "C" / "POSIX" strings file must be present. >> But this is, in my opinion, a very small sacrifice to ensure full >> purity and ease of translation. > > This is of course not acceptable. "Of course"? Why not? The reason this wouldn't be acceptable is not obvious to me. > I have in mind a way we could potentially avoid this: passing keys > like "ABMON_5" to __lctrans, and if it returns back the key (which > is what happens with the stub implementation or with no translation > present), use the builtin C locale strings instead. That would work. > I don't follow; there are only two duplicate strings and they are > "May" and "%H:%M:%S". The number does not grow with the number of > translations because it's a property of the untranslated strings > not the translated ones. If you are returning (string+1), then all strings need to have the " " at the beginning, or else you are going to return "ai" instead of "mai" for French and so on. Best, - --arw - -- A. Wilcox (awilfox) Project Lead, Adélie Linux http://adelielinux.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJaG38SAAoJEMspy1GSK50UblkQAMqHOuqFTrgbV6k5+6scBc2y a6IcldAupt6swk1b/+Bzro7n3DVcVhoBOV97ofyPSlwT1OOzFCoc6ljeqR1+TUgZ ZaFyOPICpS/1xnBqiipiQgQjn0a9/ZH7fDeb54aP3F0Jp18hrjwpvFduWcNItx/D AonDoUGecrahwwBYUYjk7GJ6Hp2hqeVGPLTpNWKwDkXTvN1CQ9HTCTRsBdaBkuFh CevzYbt4m+BQblcr4IdCHlKr5Yenb8s5aHCvV8ag/PhC1uFD6/MFu6kgKQbyqjfr ji9mD4xoX/l0rrUXqPGpdLRs5OwCpda42lGxUu9gGIUDrMt3v3YAPXTbsePTa6H6 +9cPNd562OqTqoCDiG6V7pWSapyDK+eR7swwnqNDe1Z8AyHZN3/2tJ3Gr/jH98Ko Vvjyv4sybiAgqdiu5Q/v1kKX0hVafOz7KNRKQuFt9kiUG8bj6S714CYg3WCFW7uk 30KdhI02Iy888y/nZIn6ApzmCsmx42ZZeG16CqgsbizXuyZK1kndXSaPuE7TG7Ot 0vxiz5B1Zv0ftqgEMaFeG1yqNpCPINhyYRjWMMohfrm9hi7gXQEtYWb4o+ibmb52 I/iCYdvRCcfPll48p3MNIc3w8zUDVs2vF86WQhX0nrWNnwI6urTmOdnC3L5fM4zz CzCoHkaHJIj2HEPE0V2o =MtiD -----END PGP SIGNATURE-----