diff --git a/depends.txt b/depends.txt index e795c37..1528e0d 100644 --- a/depends.txt +++ b/depends.txt @@ -2,5 +2,4 @@ default tnt dye stairs? -intllib? creative? diff --git a/init.lua b/init.lua index d58a4bc..df50e74 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,4 @@ --- Load support for intllib. -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("vehicles") vehicles = {} diff --git a/intllib.lua b/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/locale/template.txt b/locale/template.txt index d9250d6..8688fbb 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -1,4 +1,4 @@ -# Template +# textdomain: vehicles Ambulance = Armor plating = Aston Maaton (white) = @@ -61,4 +61,4 @@ neon arrows (right) = pacman sign = scifi_nodes sign = tyre stack = -whee sign +whee sign = diff --git a/locale/fr.txt b/locale/vehicles.fr.tr similarity index 98% rename from locale/fr.txt rename to locale/vehicles.fr.tr index 2d61af9..ee2d114 100644 --- a/locale/fr.txt +++ b/locale/vehicles.fr.tr @@ -1,3 +1,4 @@ +# textdomain: vehicles # Translation by Papou30 Ambulance = Ambulance Armor plating = Blindage diff --git a/locale/ms.txt b/locale/vehicles.ms.tr similarity index 98% rename from locale/ms.txt rename to locale/vehicles.ms.tr index 736939a..8939b0b 100644 --- a/locale/ms.txt +++ b/locale/vehicles.ms.tr @@ -1,3 +1,4 @@ +# textdomain: vehicles # Malay translation by muhdnurhidayat Ambulance = Ambulans Armor plating = Plat perisai diff --git a/locale/zh_CN.txt b/locale/vehicles.zh_CN.tr similarity index 98% rename from locale/zh_CN.txt rename to locale/vehicles.zh_CN.tr index 02f1147..79c41bf 100644 --- a/locale/zh_CN.txt +++ b/locale/vehicles.zh_CN.tr @@ -1,3 +1,4 @@ +# textdomain: vehicles # Translation by Zaoqi Ambulance = 救护车 Armor plating = 装甲