File: plural-4

package info (click to toggle)
gettext 0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168,104 kB
  • sloc: ansic: 532,579; sh: 68,252; perl: 28,011; makefile: 9,068; lisp: 3,184; yacc: 1,055; java: 615; cs: 589; cpp: 397; objc: 343; sed: 79; tcl: 63; xml: 40; pascal: 11; awk: 7; php: 7
file content (40 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test that ngettext() does not crash when the plural form rule leads to
# a division by zero.

test -d plural-4-dir || mkdir plural-4-dir
test -d plural-4-dir/ll || mkdir plural-4-dir/ll
test -d plural-4-dir/ll/LC_MESSAGES || mkdir plural-4-dir/ll/LC_MESSAGES

cat > plural-4-ll.po <<EOF
msgid ""
msgstr ""
"Project-Id-Version: dummy 0.0\n"
"PO-Revision-Date: 2023-09-22 12:48:44 CEST\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: lalala\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ASCII\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n!=1)+1/(n!=1666);\n"

msgid "X"
msgid_plural "Y"
msgstr[0] "x"
msgstr[1] "y"
msgstr[2] "z"
EOF

: ${MSGFMT=msgfmt}
# The option '-c' checks the evaluation only for 0 ≤ n ≤ 1000.
${MSGFMT} -c -o plural-4-dir/ll/LC_MESSAGES/plural.mo plural-4-ll.po || Exit 1

LANGUAGE= TEXTDOMAIN=plural TEXTDOMAINDIR=plural-4-dir \
$NGETTEXT --env LC_ALL=ll X Y 1666 > dataout
test $? = 0 || Exit 1
test x = `cat dataout` || Exit 1

Exit 0