summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/format-c-5
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2004-01-15 11:31:22 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:11:38 +0200
commit3c5a4919e455998175fa5e712988408f192bbaeb (patch)
tree706ebc106ef5c570d5a54199fe0298910427897c /gettext-tools/tests/format-c-5
parentcc2e0784b4e121f09c6d157a748c3015a19ac5e3 (diff)
downloadexternal_gettext-3c5a4919e455998175fa5e712988408f192bbaeb.zip
external_gettext-3c5a4919e455998175fa5e712988408f192bbaeb.tar.gz
external_gettext-3c5a4919e455998175fa5e712988408f192bbaeb.tar.bz2
Test the handling of 'I' flags in translations.
Diffstat (limited to 'gettext-tools/tests/format-c-5')
-rwxr-xr-xgettext-tools/tests/format-c-552
1 files changed, 52 insertions, 0 deletions
diff --git a/gettext-tools/tests/format-c-5 b/gettext-tools/tests/format-c-5
new file mode 100755
index 0000000..e0bfedb
--- /dev/null
+++ b/gettext-tools/tests/format-c-5
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+# Test 'I' format directive flag.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles fc5.pot"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -o fc5.pot --omit-header --no-location ${top_srcdir}/tests/format-c-5-prg.c
+
+tmpfiles="$tmpfiles fc5.ok"
+cat <<EOF > fc5.ok
+#, c-format
+msgid "father of %d children"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} fc5.ok fc5.pot || exit 1
+
+tmpfiles="$tmpfiles fa.po"
+# This should better be Farsi, not German. Can some translator help me?
+cat <<EOF > fa.po
+#, c-format
+msgid "father of %d children"
+msgstr "Vater von %Id Kindern"
+EOF
+
+tmpfiles="$tmpfiles fa"
+test -d fa || mkdir fa
+test -d fa/LC_MESSAGES || mkdir fa/LC_MESSAGES
+
+: ${MSGFMT=msgfmt}
+${MSGFMT} -o fa/LC_MESSAGES/fc5.mo fa.po
+
+tmpfiles="$tmpfiles fa.po.tmp"
+: ${MSGUNFMT=msgunfmt}
+${MSGUNFMT} fa/LC_MESSAGES/fc5.mo -o fa.po.tmp
+
+tmpfiles="$tmpfiles fa.po.strip"
+sed 1d < fa.po > fa.po.strip
+
+: ${DIFF=diff}
+${DIFF} fa.po.strip fa.po.tmp || exit 1
+
+LANGUAGE= ./fc5 fa_IR
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result