summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lconvert/data/makeplurals.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/linguist/lconvert/data/makeplurals.sh')
-rwxr-xr-xtests/auto/linguist/lconvert/data/makeplurals.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/linguist/lconvert/data/makeplurals.sh b/tests/auto/linguist/lconvert/data/makeplurals.sh
new file mode 100755
index 0000000..2e0f375
--- /dev/null
+++ b/tests/auto/linguist/lconvert/data/makeplurals.sh
@@ -0,0 +1,43 @@
+#! /bin/bash
+
+function makeit2()
+{
+ for ((i = 0; i < (1 << $1); i++)); do
+ echo
+ test -n "$3" && echo "$3"
+ echo "msgid \"singular $2 $i\""
+ echo "msgid_plural \"plural $2 $i\""
+ for ((j = 0; j < $1; j++)); do
+ tr=
+ if test $((i & (1 << j))) = 0; then
+ tr="translated $2 $i $j"
+ fi
+ echo "msgstr[$j] \"$tr\""
+ done
+ done
+}
+
+function makeit()
+{
+ {
+ cat <<EOF
+msgid ""
+msgstr ""
+"X-FooBar: yup\n"
+"X-Language: $2\n"
+EOF
+ makeit2 $1 one ""
+ makeit2 $1 two "#, fuzzy
+#| msgid \"old untranslated one\""
+ makeit2 $1 three "#, fuzzy
+#| msgid \"old untranslated two\"
+#| msgid_plural \"old untranslated plural two\""
+ makeit2 $1 four "#, fuzzy
+#| msgid_plural \"old untranslated only plural three\""
+ } > ${OUTDIR}plural-$1.po
+}
+
+OUTDIR=$1
+makeit 1 zh_CN
+makeit 2 de_DE
+makeit 3 pl_PL