1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test of gettext facilities in the YCP language. 5 6cat <<\EOF > prog.ycp 7{ 8 textdomain "prog"; 9 10 print (_("'Your command, please?', asked the waiter.")); 11 print (sformat (_("a piece of cake", "%1 pieces of cake", n), n)); 12 print (sformat (_("%1 is replaced by %2."), "FF", "EUR")); 13} 14EOF 15 16: ${XGETTEXT=xgettext} 17${XGETTEXT} -o prog.tmp --omit-header --no-location prog.ycp || Exit 1 18LC_ALL=C tr -d '\r' < prog.tmp > prog.pot || Exit 1 19 20cat <<EOF > prog.ok 21msgid "'Your command, please?', asked the waiter." 22msgstr "" 23 24#, ycp-format 25msgid "a piece of cake" 26msgid_plural "%1 pieces of cake" 27msgstr[0] "" 28msgstr[1] "" 29 30#, ycp-format 31msgid "%1 is replaced by %2." 32msgstr "" 33EOF 34 35: ${DIFF=diff} 36${DIFF} prog.ok prog.pot || Exit 1 37 38cat <<\EOF > fr.po 39msgid "" 40msgstr "" 41"Content-Type: text/plain; charset=ISO-8859-1\n" 42"Plural-Forms: nplurals=2; plural=(n > 1);\n" 43 44msgid "'Your command, please?', asked the waiter." 45msgstr "�Votre commande, s'il vous plait�, dit le gar�on." 46 47# Les gateaux allemands sont les meilleurs du monde. 48#, ycp-format 49msgid "a piece of cake" 50msgid_plural "%1 pieces of cake" 51msgstr[0] "un morceau de gateau" 52msgstr[1] "%1 morceaux de gateau" 53 54# Reverse the arguments. 55#, ycp-format 56msgid "%1 is replaced by %2." 57msgstr "%2 remplace %1." 58EOF 59 60: ${MSGMERGE=msgmerge} 61${MSGMERGE} -q -o fr.po.tmp fr.po prog.pot || Exit 1 62LC_ALL=C tr -d '\r' < fr.po.tmp > fr.po.new || Exit 1 63 64: ${DIFF=diff} 65${DIFF} fr.po fr.po.new || Exit 1 66 67Exit 0 68