User Tools

Site Tools


Sidebar



Minetest Forum
Content Database
Git Repository
Bug Tracker
Website

dev:core:funref:attrans

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

  • msgid (string): a string to translate.
  • (varargs): arguments to replace in the message ID.

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
dev/core/funref/attrans.txt · Last modified: 2020-01-22 09:51 by admin