From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7B7133858C2C for ; Mon, 11 Sep 2023 07:43:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B7133858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694418188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R2H9b18CONzF83d554co6NXS8a8yuYc4nH2GR2vOb7A=; b=ASAnpxowe7O2/0aZqO4AidaJ19lp53f7/xonj/PPKQD587RwJM55cfWKvFioek5TW9511n 1Xgtyp8QI9wBsDHh5CRwqTb3b+nu36jZ1aqgaSrcQXbnGD8WHvCmaqeC61+gg8aenvIBBW JkxkgnjW14Xow2cU2i7lNR5qUOS9EE8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-4qglGUFHNJqXhurnR4pDtA-1; Mon, 11 Sep 2023 03:43:05 -0400 X-MC-Unique: 4qglGUFHNJqXhurnR4pDtA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BAFBB8F40C0; Mon, 11 Sep 2023 07:43:04 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F02110F1BE7; Mon, 11 Sep 2023 07:43:04 +0000 (UTC) From: Florian Weimer To: Bruno Haible Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] intl: Treat C.UTF-8 locale like C locale, part 2 (BZ# 16621) References: <20230910191739.1083016-1-bruno@clisp.org> Date: Mon, 11 Sep 2023 09:43:02 +0200 In-Reply-To: <20230910191739.1083016-1-bruno@clisp.org> (Bruno Haible's message of "Sun, 10 Sep 2023 21:17:39 +0200") Message-ID: <87o7i92m0p.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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 List-Id: * Bruno Haible: > The previous commit was incomplete: gettext() still returns a translation > if the file /usr/share/locale/C/LC_MESSAGES/.mo exists. This patch > prohibits the translation also in this case. > > * gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Treat C. locale > like the C locale. > --- > intl/dcigettext.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/intl/dcigettext.c b/intl/dcigettext.c > index 27063886d2..fb69bbf94b 100644 > --- a/intl/dcigettext.c > +++ b/intl/dcigettext.c > @@ -691,9 +691,10 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, > continue; > } > > - /* If the current locale value is C (or POSIX) we don't load a > - domain. Return the MSGID. */ > - if (strcmp (single_locale, "C") == 0 > + /* If the current locale value is "C" or "C." or "POSIX", > + we don't load a domain. Return the MSGID. */ > + if ((single_locale[0] == 'C' > + && (single_locale[1] == '\0' || single_locale[1] == '.')) > || strcmp (single_locale, "POSIX") == 0) > break; I wasn't sure if this is a bug. The implementation does not fallback to translation, it just uses C as a message catalog. Do you consider this a problem? Thanks, Florian