public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: the purpose of locale.alias
Date: Tue, 12 Sep 2023 20:55:32 +0200	[thread overview]
Message-ID: <2158780.dkkaz22YKf@nimes> (raw)
In-Reply-To: <87cyyp2lcm.fsf@oldenburg.str.redhat.com>

Florian Weimer wrote:
> In addition to what is currently in intl/locale.alias, localedef creates
> additional aliases when populating the archive, along those lines.
> These aliases are currently missing from “locale -a” output, and some
> people have noticed.

You mean, the add_alias call in glibc/locale/programs/locarchive.c:1204 ?
Indeed, I see that the /usr/lib/locale/locale-archive on my system contains
aliases, equivalent to

ar_EG.ISO-8859-6 ar_EG
ar_SA.ISO-8859-6 ar_SA
de_DE.ISO-8859-1 de_DE
en_AG.UTF-8      en_AG
en_IL.UTF-8      en_IL
en_IN.UTF-8      en_IN
en_NG.UTF-8      en_NG
en_ZM.UTF-8      en_ZM
fa_IR.UTF-8      fa_IR
fr_FR.ISO-8859-1 fr_FR
zh_HK.BIG5-HKSCS zh_HK

> Without a locale archvie, this seems indeed a use
> case for locale.alias.

No, without a locale archive, this kind of aliases are automatic, due to
the directory structure on disk and the search algorithm in
glibc/intl/l10nflist.c. See this experiment:

  # localedef --no-archive -i hy_AM -f UTF-8 hy_AM
  # LC_ALL=hy_AM locale
  (OK)
  # LC_ALL=hy_AM.UTF-8 locale
  (OK)
  # LC_ALL=hy_AM.ISO-8859-1 locale
  locale: Cannot set LC_CTYPE to default locale: No such file or directory
  locale: Cannot set LC_MESSAGES to default locale: No such file or directory
  locale: Cannot set LC_ALL to default locale: No such file or directory
  ...

This shows that an alias
  hy_AM.UTF-8 hy_AM
in locale.alias is not needed.


Thanks for your feedback. I'm submitting a patch, to update the comments,
in a separate mail.

Bruno




  reply	other threads:[~2023-09-12 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-10  8:55 Bruno Haible
2023-09-11  7:57 ` Florian Weimer
2023-09-12 18:55   ` Bruno Haible [this message]
2023-09-12 19:28     ` Florian Weimer

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=2158780.dkkaz22YKf@nimes \
    --to=bruno@clisp.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).