Table of Contents

attrans

Translates a specified string. Symbolic reference to intllib.Getter.

Note: this page has been written for Advtrains 2.0.1 TSS and Minetest 5.1.0. Examples and practices described in this page don't take advantage of improvements introduced in later releases.

Syntax

attrans(msgid, ...)

Parameters

Returns

The translated string.

In source code

advtrains/init.lua, lines 6 to 10:

attrans.lua
if minetest.get_modpath("intllib") then
    attrans = intllib.Getter()
else
    attrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
end