From: Isidor Zeuner Date: Sat, 3 Apr 2021 22:35:32 +0000 (+0200) Subject: server side translation X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a689b54804072f744418a572aff7a6e75ad84505;p=lmz_opening_hours.git server side translation --- diff --git a/init.lua b/init.lua index 4918f61..abb0e5a 100644 --- a/init.lua +++ b/init.lua @@ -103,6 +103,11 @@ local function load_data() elseif not opening_hours.version then opening_hours = opening_hours_default end + for k, v in pairs(opening_hours) do + if k ~= "exception_today" then + opening_hours[k] = tonumber(v) + end + end end local function reset_execption() @@ -231,6 +236,33 @@ local function show_gui(name) [5] = S("Fr."), [6] = S("Sa.") } + local player_info = minetest.get_player_information(name) + local warning_config_translation_string = S( + "@1 minutes before closing, warn the players every @2 minutes.", + "", + "" + ) + local warning_config = minetest.get_translated_string( + player_info.lang_code, + warning_config_translation_string + ) .. "<" + local formspec_warning = "" + local warning_x = 0.34 + for fragment in warning_config:gmatch("([^<>]+