From cc78b63e342c131e2a08b3697681d9d5fbf86d4f Mon Sep 17 00:00:00 2001 From: ywang Date: Sun, 19 Jul 2020 15:50:34 +0200 Subject: [BREAKING] Use client-side translations instead of intllib; add zh_CN translations * Client-side translations is used instead of intllib. [Breaks MT4 compat] * Existing locale files have been moved to advtrains/locale and named with the format advtrains.[lang].tr * Add zh_CN locale. (requires a font that supports CJK text) --- advtrains/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'advtrains/init.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index 84cfa38..d6c3c92 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -22,12 +22,8 @@ Copyright (C) 2016-2020 Moritz Blei (orwell96) and contributors local lot = os.clock() minetest.log("action", "[advtrains] Loading...") --- Boilerplate to support localized strings if intllib mod is installed. -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 +-- There is no need to support 0.4.x anymore given that the compatitability with it is already broken by 1bb1d825f46af3562554c12fba35a31b9f7973ff +attrans = minetest.get_translator ("advtrains") --advtrains -- cgit v1.2.3