3 # Test of gettext facilities in the YCP language.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles prog.ycp"
13 print
(_
("'Your command, please?', asked the waiter."));
14 print
(sformat
(_
("a piece of cake", "%1 pieces of cake", n
), n
));
15 print
(sformat
(_
("%1 is replaced by %2."), "FF", "EUR"));
19 tmpfiles
="$tmpfiles prog.pot"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} -o prog.pot
--omit-header --no-location prog.ycp
23 tmpfiles
="$tmpfiles prog.ok"
25 msgid "'Your command, please?', asked the waiter."
29 msgid "a piece of cake"
30 msgid_plural "%1 pieces of cake"
35 msgid "%1 is replaced by %2."
40 ${DIFF} prog.ok prog.pot ||
exit 1
42 tmpfiles
="$tmpfiles fr.po"
46 "Content-Type: text/plain; charset=ISO-8859-1\n"
47 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
49 msgid
"'Your command, please?', asked the waiter."
50 msgstr
"«Votre commande, s'il vous plait», dit le garçon."
52 # Les gateaux allemands sont les meilleurs du monde.
54 msgid
"a piece of cake"
55 msgid_plural
"%1 pieces of cake"
56 msgstr
[0] "un morceau de gateau"
57 msgstr
[1] "%1 morceaux de gateau"
59 # Reverse the arguments.
61 msgid
"%1 is replaced by %2."
62 msgstr
"%2 remplace %1."
65 tmpfiles
="$tmpfiles fr.po.new"
66 : ${MSGMERGE=msgmerge}
67 ${MSGMERGE} -q -o fr.po.new fr.po prog.pot
70 ${DIFF} fr.po fr.po.new ||
exit 1