From patchwork Tue Sep 12 18:56:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Haible X-Patchwork-Id: 75786 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 929713857806 for ; Tue, 12 Sep 2023 18:57:15 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.21]) by sourceware.org (Postfix) with ESMTPS id 935463858C2A for ; Tue, 12 Sep 2023 18:57:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 935463858C2A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=clisp.org ARC-Seal: i=1; a=rsa-sha256; t=1694545019; cv=none; d=strato.com; s=strato-dkim-0002; b=GSU+tASbNHpPfqMNbyO8XQ6Et+CoZfSNsvIxTjM30JrqBlPCRlvjhCaHBwWYWifv4R lZ9qURqKPtKx4U94eJrIqE97KYivJaY+5/Mw+vly+G/i99ge7Zmui9oBbtOPEa69wwLg K84FKw33eYKJTOnuYctPCrVGoTAY8+W3r55DnvsjKn8YZjHJn95wPa/zWSa3iF66GhL1 CM22SPsHkWSMqKdQ50z1sP+Xsnm630uC/8RDx08mCiWTJ7RgG+8kYuUPxSyorTM2lB02 u+36IcGs9mkcfLnVAZ6dp4BkqF4ERK0oFDk7idor2iHuVIOO7970MBMt4KfJWzxqow54 RJoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1694545019; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=QiqTPUbI2NQ13+Gn7SqHvVpBip9UvXBScbhY2r6ZaXM=; b=oH9evQYibrS6qAjoC6Hvl4LG0xIAbHnlNUb+Jzy8TmhHxDo5jIz0Y3QJpzgeRNMLoh Dr9dIMtN9UXP7ukv9Np16P5G9K6FYQTJNFBwXwlvn19N8Q1pLGMqLW/Da3la6jmzKa1J uG7DMUIrWrfRRUkwCnwcwU9/c57HW6zkrUFE5cVv7NC4LSjLd7ux02RqboEK+gHoNqMN KA4wgm4PSVNl1fXJ2TXmk/87vW1C8/TTX8pMbbbRcsvdr4PxJR/IPITpx2aCgzOIUJky e+OOXEg/8Rnm9eJvhotkYXtXe1Dfi4iu+E/sMfDA3o/hnXJ4BNnvp4iOLVHdNZNJGcnF x1jA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1694545019; s=strato-dkim-0002; d=clisp.org; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=QiqTPUbI2NQ13+Gn7SqHvVpBip9UvXBScbhY2r6ZaXM=; b=r8BTEK2bDcCc/KSKQX7nRp2cZPBSbB9UaWU5Mbn/VkNvSnbJF4gM7BwiFJTQe/mbPe sNlozKIQGH+sgob22h1wP6sY75UBXIsNQhetdE07DyFwlr4pFZ2bFh0PzE+zwfSpBuuL ZEzhaAr7sTcq4VxafALQdJGCjxNBr77s8GTO3Ni3JHG2Czunz1mZ1GJ/wC6k/QHj/sga Xgk90gThCpHrMzD4itAmzifhvtfwjTVU/VQqrLIs8E79BTSTXY8tmNm+8mXjgA9lpL9U SSydZ+gseYU/pbv51GPZgSyi+tGZs3HKm7u0DdWLsba/KG5yXXXSYk+abPCYHcVKyJGp GIgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1694545019; s=strato-dkim-0003; d=clisp.org; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=QiqTPUbI2NQ13+Gn7SqHvVpBip9UvXBScbhY2r6ZaXM=; b=34AYRdp3aHFxgm7P0x7GgpnKV2fwmspDXLtUytgZozTUP2P53ElSjZw3Ajs4zOMc+S PCh5GxfpMcx8JsRk1JCw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOTiPSPDUfxpScP9m5S8VeRbWcTxQ==" Received: from nimes.fritz.box by smtp.strato.de (RZmta 49.8.2 AUTH) with ESMTPSA id m03934z8CIux8L1 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 12 Sep 2023 20:56:59 +0200 (CEST) From: Bruno Haible To: libc-alpha@sourceware.org Cc: Bruno Haible Subject: [PATCH] intl: Clarify the role and the contents of locale.alias. Date: Tue, 12 Sep 2023 20:56:42 +0200 Message-Id: <20230912185642.3949935-1-bruno@clisp.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org * intl/localealias.c: Explain the form and the purpose of the locale.alias file. * intl/locale.alias: Don't state that this file is obsolete. Instead, two groups of entries are obsolete, for different reasons. --- intl/locale.alias | 18 +++++++++++------- intl/localealias.c | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/intl/locale.alias b/intl/locale.alias index 8904983a59..471da95f32 100644 --- a/intl/locale.alias +++ b/intl/locale.alias @@ -19,12 +19,10 @@ # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. +# Lines that start with '#' are comment lines. -# Note: This file is obsolete and is kept around for the time being for -# backward compatibility. Nobody should rely on the names defined here. -# Locales should always be specified by their full name. - -# Note: This file used to contain the following lines: +# Note: This file should only contain ASCII characters. It used to +# contain the following lines: # bokmaal nb_NO.ISO-8859-1 # franc,ais fr_FR.ISO-8859-1 # except that the "aa" was actually the byte '\0xE5' (the Latin-1 @@ -35,6 +33,9 @@ # which broke applications in UTF-8 locales. See: # https://sourceware.org/bugzilla/show_bug.cgi?id=18412 +# The following entries are obsolete. They date back to 1996-2000, when +# it was not customary to use real locale names. Locales should nowadays +# always be specified by their full name. bokmal nb_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 @@ -65,8 +66,6 @@ korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 -no_NO nb_NO.ISO-8859-1 -no_NO.ISO-8859-1 nb_NO.ISO-8859-1 norwegian nb_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 @@ -80,3 +79,8 @@ spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 + +# The following entries are obsolete. They date back to the transition +# from the ISO 639 language code 'no' to 'nb', in 2003. +no_NO nb_NO.ISO-8859-1 +no_NO.ISO-8859-1 nb_NO.ISO-8859-1 diff --git a/intl/localealias.c b/intl/localealias.c index ea4f48b594..cab4ce44ef 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -14,6 +14,31 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ +/* Locale aliases can be specified in the file $(localedir)/locale.alias. + It consists of lines of the form + + Lines that start with '#' are comment lines. + + The main purpose of locale aliases is allow a seamless transition when + a locale is replaced by another one, and the users still want to use + the old locale name in their .profile scripts and elsewhere. + This typically happens when + (a) The ISO 639 language code of a language changes. For example, + around 2003, the no_NO locale was withdrawn in favour of two + separate locales nb_NO and nn_NO. Users in Norway could have + used the alias + no_NO.UTF-8 nb_NO.UTF-8 + or + no_NO.UTF-8 nn_NO.UTF-8 + depending on the language they speak. + (b) The ISO 3166 country code of a territory changes. For example, + users in South Sudan saw their ISO 3166 country code change from + SD to SS in 2011, and their locale name changed from ar_SD.UTF-8 + to ar_SS.UTF-8 in 2013 accordingly. During the transition, they + may have used the alias + ar_SD.UTF-8 ar_SS.UTF-8 + */ + /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */