From patchwork Wed May 13 05:38:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 39232 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 47ED1387084D; Wed, 13 May 2020 05:38:17 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id BE279386F82A for ; Wed, 13 May 2020 05:38:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BE279386F82A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jYk5t-0000UI-OB for libc-alpha@sourceware.org; Wed, 13 May 2020 05:38:13 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jYk5t-0004Y3-LW for libc-alpha@sourceware.org; Wed, 13 May 2020 07:38:13 +0200 From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] locales: Add Geresh to abbreviated day names in he_IL [BZ #25970] Date: Wed, 13 May 2020 07:38:13 +0200 Message-ID: <87d0788ke2.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- localedata/Makefile | 6 +++++- localedata/locales/he_IL | 9 ++++++--- localedata/tst-geresh.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/localedata/Makefile b/localedata/Makefile index ccfcb0049f..a78c83cdbd 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -158,7 +158,7 @@ tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \ tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \ - tst-wctype tst-iconv-math-trans + tst-wctype tst-iconv-math-trans tst-geresh tests-static = bug-setlocale1-static tests += $(tests-static) ifeq (yes,$(build-shared)) @@ -234,6 +234,9 @@ LOCALES := \ fur_IT.UTF-8 \ gez_ER.UTF-8@abegede \ ha_NG.UTF-8 \ + he_IL.UTF-8 \ + he_IL.ISO-8859-8 \ + he_IL.CP1255 \ hr_HR.ISO-8859-2 \ hr_HR.UTF-8 \ hsb_DE.UTF-8 \ @@ -295,6 +298,7 @@ LOCALES := \ include ../gen-locales.mk $(objpfx)tst-iconv-math-trans.out: $(gen-locales) +$(objpfx)tst-geresh.out: $(gen-locales) endif include ../Rules diff --git a/localedata/locales/he_IL b/localedata/locales/he_IL index 42fd260115..857e991eda 100644 --- a/localedata/locales/he_IL +++ b/localedata/locales/he_IL @@ -58,6 +58,9 @@ copy "i18n" translit_start include "translit_combining";"" + +% HEBREW PUNCTUATION GERESH + "'" translit_end END LC_CTYPE @@ -90,9 +93,9 @@ grouping 3;3 END LC_NUMERIC LC_TIME -abday "'";"'";"'";/ - "'";"'";"'";/ - "'" +abday "";"";"";/ + "";"";"";/ + "" day "";/ "";/ "";/ diff --git a/localedata/tst-geresh.c b/localedata/tst-geresh.c new file mode 100644 index 0000000000..1ff9bb9d80 --- /dev/null +++ b/localedata/tst-geresh.c @@ -0,0 +1,45 @@ +/* Test transliteration of Geresh in he_IL locale (bug 25970). + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +/* Run a test in LOCALE, with the EXPECTED output. */ +static void +test_one (const char *locale, const char *expected) +{ + xsetlocale (LC_ALL, locale); + char actual[100]; + time_t epoch = 1589300438; /* An arbitrary date (matching EXPECTED). */ + TEST_VERIFY (strftime (actual, sizeof (actual), "%a", gmtime (&epoch)) != 0); + TEST_COMPARE_STRING (actual, expected); +} + +static int +do_test (void) +{ + test_one ("he_IL.UTF-8", "\327\222\327\263"); + test_one ("he_IL.ISO-8859-8", "\342'"); /* Geresh is transliterated to '. */ + test_one ("he_IL.CP1255", "\342\327"); /* Geresh uses codepoint. */ + + return 0; +} + +#include