1#!/bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test Lua comment syntax 5 6cat <<\EOF > xg-lu-2.lua 7-- This comment won't be extracted. 8print(_"Hmm.") 9-- Neither this one. 10print(_"Test.") 11-- TRANSLATORS: Hello translators, how are you today? 12print(_"We're fine, thanks.") 13--[[ Do not extract this, please ]] 14 15--[[ TRANSLATORS: 16Attention! 17]] 18print(--[=[ TRANSLATORS: This is a comment for you!]=] _(--[[TRANSLATORS: Nobody else is supposed to read this!]] 19"flowers" --[===[ TRANSLATORS: Nobody will see this.]===] .. --[[ TRANSLATORS: How sad.]] " and " .. --[[Secret text!]] 20"biscuits" --[=[TRANSLATORS: Hey you!]=])) 21 22--[==[TRANSLATORS: :-]]==] 23print(_"A string.") 24EOF 25 26: ${XGETTEXT=xgettext} 27${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ 28 -d xg-lu-2.tmp xg-lu-2.lua || Exit 1 29LC_ALL=C tr -d '\r' < xg-lu-2.tmp.po > xg-lu-2.po || Exit 1 30 31cat <<EOF > xg-lu-2.ok 32msgid "Hmm." 33msgstr "" 34 35msgid "Test." 36msgstr "" 37 38#. TRANSLATORS: Hello translators, how are you today? 39msgid "We're fine, thanks." 40msgstr "" 41 42#. TRANSLATORS: 43#. Attention! 44#. 45#. TRANSLATORS: This is a comment for you! 46#. TRANSLATORS: Nobody else is supposed to read this! 47msgid "flowers and biscuits" 48msgstr "" 49 50#. TRANSLATORS: :-] 51msgid "A string." 52msgstr "" 53EOF 54 55: ${DIFF=diff} 56${DIFF} xg-lu-2.ok xg-lu-2.po 57result=$? 58 59exit $result 60