#!/bin/sh # Test Lua support tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 tmpfiles="$tmpfiles xg-lu-2.lua" cat <<\EOF > xg-lu-2.lua -- This comment won't be extracted. print(_"Hmm.") -- Neither this one. print(_"Test.") -- TRANSLATORS: Hello translators, how are you today? print(_"We're fine, thanks.") --[[ Do not extract this, please ]] --[[ TRANSLATORS: Attention! ]] print(--[=[ TRANSLATORS: This is a comment for you!]=] _(--[[TRANSLATORS: Nobody else is supposed to read this!]] "flowers" --[===[ TRANSLATORS: Nobody will see this.]===] .. --[[ TRANSLATORS: How sad.]] " and " .. --[[Secret text!]] "biscuits" --[=[TRANSLATORS: Hey you!]=])) --[==[TRANSLATORS: :-]]==] print(_"A string.") EOF tmpfiles="$tmpfiles xg-lu-2.tmp.po xg-lu-2.po" : ${XGETTEXT=xgettext} ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ -d xg-lu-2.tmp xg-lu-2.lua test $? = 0 || { rm -fr $tmpfiles; exit 1; } LC_ALL=C tr -d '\r' < xg-lu-2.tmp.po > xg-lu-2.po test $? = 0 || { rm -fr $tmpfiles; exit 1; } tmpfiles="$tmpfiles xg-lu-2.ok" cat < xg-lu-2.ok msgid "Hmm." msgstr "" msgid "Test." msgstr "" #. TRANSLATORS: Hello translators, how are you today? msgid "We're fine, thanks." msgstr "" #. TRANSLATORS: #. Attention! #. #. TRANSLATORS: This is a comment for you! #. TRANSLATORS: Nobody else is supposed to read this! msgid "flowers and biscuits" msgstr "" #. TRANSLATORS: :-] msgid "A string." msgstr "" EOF : ${DIFF=diff} ${DIFF} xg-lu-2.ok xg-lu-2.po result=$? rm -fr $tmpfiles exit $result