summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14dcd54)
raw | patch | inline | side by side (parent: 14dcd54)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Mon, 30 Aug 2010 16:59:13 +0000 (16:59 +0000) | ||
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sat, 30 Oct 2010 07:10:07 +0000 (07:10 +0000) |
A test that tests that calling gettext on a UTF-8 msgid works, and
that recoding the resulting string works too.
This test uses the --from-code=UTF-8 xgettext(1) argument introduced
in an earlier patch.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
that recoding the resulting string works too.
This test uses the --from-code=UTF-8 xgettext(1) argument introduced
in an earlier patch.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
po/is.po | patch | blob | history | |
t/t0200/test.c | patch | blob | history | |
t/t0204-gettext-reencode-sanity.sh | patch | blob | history |
diff --git a/po/is.po b/po/is.po
index e2c1414cfffa61a357d582f17c1e4607a9898a77..815286bebe5174731406e7d812e6308bd161e79a 100644 (file)
--- a/po/is.po
+++ b/po/is.po
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2010-09-20 14:43+0000\n"
+"POT-Creation-Date: 2010-09-20 14:44+0000\n"
"PO-Revision-Date: 2010-06-05 19:06 +0000\n"
"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n"
"Language-Team: Git Mailing List <git@vger.kernel.org>\n"
msgid "TEST: Old English Runes"
msgstr "TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ"
+#. TRANSLATORS: This is a test. You don't need to translate it.
+#: t/t0200/test.c:21
+#, c-format
+msgid "TEST: ‘single’ and “double” quotes"
+msgstr "TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir"
+
#. TRANSLATORS: This is a test. You don't need to translate it.
#: t/t0200/test.sh:8
msgid "TEST: A Shell test string"
diff --git a/t/t0200/test.c b/t/t0200/test.c
index 82682dce1ce5099a46900ad27bfd9db63817474b..ff15c2f910e8b84ff44cacc4c59b76e3dd077355 100644 (file)
--- a/t/t0200/test.c
+++ b/t/t0200/test.c
/* TRANSLATORS: This is a test. You don't need to translate it. */
printf(_("TEST: Old English Runes"));
+
+ /* TRANSLATORS: This is a test. You don't need to translate it. */
+ printf(_("TEST: ‘single’ and “double” quotes"));
}
index 3222e37cd503530b79d56c354c834267f36a39e4..1a7ea37e89178fe968a9c049326ada58a9808af5 100755 (executable)
fi
'
+test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid -> UTF-8' '
+ printf "TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir" >expect &&
+ LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: ‘single’ and “double” quotes" >actual &&
+ test_cmp expect actual
+'
+
+# How these quotes get transliterated depends on the gettext implementation:
+#
+# Debian: ,einfaldar' og ,,tvöfaldar" [GNU libintl]
+# FreeBSD: `einfaldar` og "tvöfaldar" [GNU libintl]
+# Solaris: ?einfaldar? og ?tvöfaldar? [Solaris libintl]
+#
+# Just make sure the contents are transliterated, and don't use grep -q
+# so that these differences are emitted under --verbose for curious
+# eyes.
+test_expect_success GETTEXT_ISO_LOCALE 'gettext: Fetching a UTF-8 msgid -> ISO-8859-1' '
+ LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: ‘single’ and “double” quotes" >actual &&
+ grep "einfaldar" actual &&
+ grep "$(echo tvöfaldar | iconv -f UTF-8 -t ISO8859-1)" actual
+'
+
test_done