6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-lu-1.lua"
9 cat <<\EOF > xg-lu-1.lua
10 print(_("This is a test string."))
11 print(_('And another one.'))
12 print(_("Don't be afraid to extract this one."))
13 print(_('I don\'t bite!'))
14 print(_("I said: \"This is a test.\""))
15 print(_('He said: "You\'re right!"'))
16 print(_([[I like brackets.]]))
17 print(_([===[Brackets are awesome!]===]))
24 print(_("abc" .. "def"))
25 print(speed / 1000 .. 'Mbps')
28 tmpfiles="$tmpfiles xg-lu-1.tmp.po xg-lu-1.po"
29 : ${XGETTEXT=xgettext}
30 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
31 -d xg-lu-1.tmp xg-lu-1.lua
32 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
33 LC_ALL=C tr -d '\r' < xg-lu-1.tmp.po > xg-lu-1.po
34 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
36 tmpfiles="$tmpfiles xg-lu-1.ok"
37 cat <<EOF > xg-lu-1.ok
38 msgid "This is a test string."
41 msgid "And another one."
44 msgid "Don't be afraid to extract this one."
50 msgid "I said: \"This is a test.\""
53 msgid "He said: \"You're right!\""
56 msgid "I like brackets."
59 msgid "Brackets are awesome!"
76 ${DIFF} xg-lu-1.ok xg-lu-1.po