mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: locale fallback option
Date: Sun, 27 Jul 2014 04:12:52 -0400	[thread overview]
Message-ID: <20140727081252.GV4038@brightrain.aerifal.cx> (raw)
In-Reply-To: <CALONj1cv1z_PiGKDDbaG4eVZOdAYa_fhw6YaGxGyasDc=T+kKA@mail.gmail.com>

On Sun, Jul 27, 2014 at 07:26:27AM +0200, Wermut wrote:
> Hi
> 
> I think your statements make sense :) BTW, by adding locale to musl
> you probably opened the pandora :)
> 
> You are right with the LC_* fallback. If you setup a new translation
> team, then probably these files are the first that get implemented.
> 
> The GNU LANGUAGE is indeed working for some use cases, but still
> has/had some limitations, when I tried it some time ago. The problem
> was, that LC_TIME etc. where not properly overwritten by gettext
> according to LANGUAGE. That means if I set "LC_ALL=xyz_AB" and added
> "LANGUAGE=xyz:ts", the dates with programs no translation in  to "xyz"
> had still the Dates etc. formatted according to it. In west european
> languages this is a no brainer, but it got ugly once you use different
> scripts to write both langs. Like mixing arabic and english.

I think I understand what you're saying, but I don't see any
alternative. The standard libc interfaces are required to honor the
LANG/LC_* variables, not other settings (i.e. LANGUAGE), and thus if
LC_TIME is xyz_AB, time/date strings are going to be in language xyz,
regardless of the language of message strings.

This is probably a bit disconcerting, but won't this kind of thing
happen anyway with mixed LANGUAGE fallback? For instance if app FOO
uses library BAR and BAZ, and only BAR has a translation in language
xyz, you'll see strings from BAR in language xyz mixed (possibly even
in the same text areas) with strings from FOO and BAZ in language ts.

Do you have any suggestions for how this situation could be improved?

> If at least gettext is made properly and would allow a really proper
> LANGUAGE functionality, then probably I would be happy.

I've got gettext working and ready to commit, but so far it's without
the LANGUAGE fallback system. I don't think it will be too hard to
add, and I think I could even make it fallback for individual strings
if desired at little or no extra cost. I'm going to commit the basic
working code first though then look into adding more features.

Rich


  reply	other threads:[~2014-07-27  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26 21:46 Wermut
2014-07-26 21:51 ` writeonce
2014-07-27  2:08 ` Rich Felker
2014-07-27  5:26   ` Wermut
2014-07-27  8:12     ` Rich Felker [this message]
2014-07-27  8:08 ` u-igbb
2014-07-27  8:18   ` Rich Felker
2014-07-27  8:45     ` 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=20140727081252.GV4038@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).