mailing list of musl libc
 help / color / mirror / code / Atom feed
From: u-igbb@aetey.se
To: musl@lists.openwall.com
Subject: Re: Locale bikeshed time
Date: Fri, 25 Jul 2014 11:06:49 +0200	[thread overview]
Message-ID: <20140725090649.GN16795@example.net> (raw)
In-Reply-To: <20140724220228.GB4038@brightrain.aerifal.cx>

On Thu, Jul 24, 2014 at 06:02:28PM -0400, Rich Felker wrote:
> first you would need an idea of what some "non-language" category
> values might be. I can think of some for LC_COLLATE, though I'm not
> sure how valuable many of them are:
> 
> - UCA default tables
> - UTF-16 code unit order
> - Case-insensitive Unicode codepoint order

I can hardly give any opinion on their importance.

> For the other categories, examples seem much harder to find.
> LC_MESSAGES is inherently a language-based category, but perhaps you
> could have a locale that eliminates verbose natural-language messages
> and replaces them with C/POSIX identifiers (e.g. printing ENOENT
> instead of "No such file or directory") conveying the meaning. (Or we
> could be somewhat radical and replace all the internal strerror
> messages like this and require LC_MESSAGES=en to get them back.) I'm

I like this - for clarity, conciseness and for making it as neutral
as possible (ENOENT stems of course from English but no worse than
the keywords of C itself).

> LC_MONETARY, most if not all of the data really corresponds to a
> political unit context, not a language, so in principle it might make
> sense to have locales just for LC_MONETARY that aren't associated with
> a language, but I can't see that being a convenient or reasonable
> design in practice...

Indeed, LC_MONETARY has basically nothing to do with language.

If I might choose I would not let LANG imply LC_MONETARY
(iow would skip LC_MONETARY in language-based locale definitions).

Returning to the naming. As language-based locales are named
after languages, it would be nice to name other kinds of locale
data after their "natural association" too. Then politically-bound
data could be put into the corresponding "territorial" family:

 language                ll[l][_TT]
 territory               TT[_ll[l]]

And if we find something that does not feel reasonable to connect
to either a language or a territory, we can do

 special cases           @<specialcase>

[or                       ZZ@<specialcase>     ("no territory")
 or                       zxx@<specialcase>    ("no language")
 but the shorter and simpler is to prefer]

The expected mode of usage would be like

LANG=de LC_MONETARY=EU
 or
LANG=sv LC_MONETARY=SE
 or
LANG=eo@iso8601 LC_MONETARY=US@iso4217

which would in every case access two locale data files of different
classes, clearly visible in the naming.

Iso date format actually would be a good candidate for a standalone
"@iso8601", but it can as well live inside the C locale.
Then the last example above might look like

LANG=eo LC_TIME=@iso8601 LC_MONETARY=US@iso4217
 at the expense of a third file to be accessed
 or rather
LANG=eo LC_TIME=C LC_MONETARY=US@iso4217

What do you think about such a naming convention and usage mode?

Rune



  reply	other threads:[~2014-07-25  9:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 18:49 Rich Felker
2014-07-22 20:10 ` u-igbb
2014-07-22 20:35   ` Rich Felker
2014-07-23  9:50     ` u-igbb
2014-07-23 16:39       ` Rich Felker
2014-07-23 19:25         ` u-igbb
2014-07-23 21:01           ` Rich Felker
2014-07-24 15:35             ` u-igbb
2014-07-24 16:01               ` Rich Felker
2014-07-24 19:24                 ` u-igbb
2014-07-24 20:15                 ` u-igbb
2014-07-24 22:02                   ` Rich Felker
2014-07-25  9:06                     ` u-igbb [this message]
2014-07-25 20:15                       ` u-igbb
2014-07-25 22:32                         ` Rich Felker
2014-07-26  7:25                           ` u-igbb
2014-07-26  8:03                             ` Rich Felker
2014-07-26  9:06                               ` Jens Gustedt
2014-07-26  9:25                                 ` Rich Felker
2014-07-26  9:38                               ` u-igbb
2014-07-26 17:47                                 ` Szabolcs Nagy
2014-07-26 18:23                                   ` Rich Felker
2014-07-26 18:59                                     ` u-igbb
2014-07-26 19:14                                       ` Rich Felker
2014-07-26 18:56                                   ` u-igbb
2014-07-26 19:30                                     ` Rich Felker
2014-07-27  7:28                                       ` u-igbb
2014-07-26 20:43                         ` Rich Felker
2014-07-27  7:51                           ` u-igbb
2014-07-27  8:00                             ` Rich Felker
2014-07-27  8:24                               ` u-igbb
2014-07-23 23:22         ` writeonce
2014-07-23 23:38           ` Rich Felker
2014-07-24  1:07             ` writeonce
2014-07-24  1:57               ` Rich Felker
2014-07-24  2:16                 ` writeonce
2014-07-24  2:24                   ` Rich Felker
2014-07-24  2:59                     ` writeonce
2014-07-22 20:17 ` Laurent Bercot
2014-07-22 20:36   ` Rich Felker
2014-07-23 22:03     ` Laurent Bercot
2014-07-23 22:12       ` Rich Felker
2014-07-24 15:38         ` u-igbb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140725090649.GN16795@example.net \
    --to=u-igbb@aetey.se \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).