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/atc.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'advtrains/atc.lua') diff --git a/advtrains/atc.lua b/advtrains/atc.lua index fa9f097..20f52b9 100644 --- a/advtrains/atc.lua +++ b/advtrains/atc.lua @@ -128,9 +128,9 @@ advtrains.atc_function = function(def, preset, suffix, rotation) if fields.mode then meta:set_string("mode", idxtrans[fields.mode]) if fields.mode=="digiline" then - meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) + meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", (fields.mode or "?"), meta:get_string("command")) ) else - meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) + meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", (fields.mode or "?"), meta:get_string("command")) ) end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) end @@ -141,9 +141,9 @@ advtrains.atc_function = function(def, preset, suffix, rotation) meta:set_string("command_on", fields.command_on) meta:set_string("channel", fields.channel) if fields.mode=="digiline" then - meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", fields.mode, meta:get_string("command")) ) + meta:set_string("infotext", attrans("ATC controller, mode @1\nChannel: @2", (fields.mode or "?"), meta:get_string("command")) ) else - meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", fields.mode, meta:get_string("command")) ) + meta:set_string("infotext", attrans("ATC controller, mode @1\nCommand: @2", (fields.mode or "?"), meta:get_string("command")) ) end meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta)) -- cgit v1.2.3