S("Start-of-file string") -- ^ this must be at the very beginning of the file --[[ === LUA TEST FILE FOR mod_translation_updater.py === This file contains dummy function calls to test if the mod_translation_updater.py script works as expected. ]] -- A simple string S("Hello World") -- Tests placeholders S("You have @1 gold coins.", coins) S("@1 has mined @2 diamond ores.", player_name, ores) -- @ sign tests. Note that in the Lua file, the '@' MUST be escaped S("@@") S("@@@@") S("@@a") S("@@n") S("email@@example.org") S("A @@ @@@@") S("A @@ @@@@B") -- Equals sign tests because that's the delimiter in TR file -- and could trip up the script. -- In the .tr file, the "=" MUST become "@=" S("=") S("1+1=2") -- Combination of "@" and "=". -- In the .tr file, the "=" MUST become "@=" S("@@=") S("=@@") S("@@=@@") -- The empty string is technically not forbidden S("") -- Test other string delimiters S('string in single quotes') S([[string in brackets]]) S([[string in brackets with new line]]) -- Concatenation of string literls -- NOTE: concatenation with variables is NOT supported. This is by design. S("concate-".."nation") S("concatenated" .. " " .. "string" .. " " .. "literals") -- Test the other function names -- and alternative syntactical ways to call the function NS("string in NS()") FS("string in FS()") NFS("string in NFS()") local string_assignment = S("string assignment") S ( "spaces in function call" ) S ( "tabs in function call" ) --[[ TRAP STRING ZONE ]] -- Strings in this section are TRAPS -- and must be either ignored by the script. -- Function name S, NS, FS or NFS, but with "INVALID" in front INVALIDS("BAD STRING: INVALIDS") INVALIDNS("BAD STRING: INVALIDNS") INVALIDFS("BAD STRING: INVALIDFS") INVALIDNFS("BAD STRING: INVALIDNFS") -- Calling a variable should not do anything S(I_AM_A_VARIABLE_DO_NOT_COLLECT_ME) --[[ INVALID STRING ZONE ]] -- Strings in this section are syntactically wrong due to -- unescaped @ signs. -- All strings MUST trigger an error and not appear in the resulting *.tr file S("BAD STRING: @") S("@X") S("@")