diff mbox series

locales: Add Geresh to abbreviated day names in he_IL [BZ #25970]

Message ID 87d0788ke2.fsf@mid.deneb.enyo.de
State New
Headers show
Series locales: Add Geresh to abbreviated day names in he_IL [BZ #25970] | expand

Commit Message

Florian Weimer May 13, 2020, 5:38 a.m. UTC
---
 localedata/Makefile      |  6 +++++-
 localedata/locales/he_IL |  9 ++++++---
 localedata/tst-geresh.c  | 45 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 4 deletions(-)
diff mbox series

Patch

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
+<U05F3> "'"
 translit_end
 END LC_CTYPE
 
@@ -90,9 +93,9 @@  grouping          3;3
 END LC_NUMERIC
 
 LC_TIME
-abday   "<U05D0>'";"<U05D1>'";"<U05D2>'";/
-        "<U05D3>'";"<U05D4>'";"<U05D5>'";/
-	"<U05E9>'"
+abday   "<U05D0><U05F3>";"<U05D1><U05F3>";"<U05D2><U05F3>";/
+        "<U05D3><U05F3>";"<U05D4><U05F3>";"<U05D5><U05F3>";/
+	"<U05E9><U05F3>"
 day     "<U05E8><U05D0><U05E9><U05D5><U05DF>";/
         "<U05E9><U05E0><U05D9>";/
         "<U05E9><U05DC><U05D9><U05E9><U05D9>";/
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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <locale.h>
+#include <time.h>
+#include <support/check.h>
+#include <support/support.h>
+
+/* 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 <support/test-driver.c>