+ local player_info = minetest.get_player_information(name)
+ local warning_config_translation_string = S(
+ "@1 minutes before closing, warn the players every @2 minutes.",
+ "<warn_offset>",
+ "<warn_interval>"
+ )
+ 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("([^<>]+<?)") do
+ local label = fragment:match("<$")
+ if label then
+ fragment = fragment:gsub("<$", "")
+ end
+ if label then
+ formspec_warning = formspec_warning ..
+ "label[" .. warning_x .. "," .. lab_close_y .. ";" .. fragment .. "]"
+ warning_x = warning_x + 0.125 * fragment:len()
+ else
+ formspec_warning = formspec_warning ..
+ "field[" .. (warning_x + 0.2) .. "," .. fld_close_y .. ";" .. fld_sz .. ";fld_" .. fragment .. ";;" .. o[fragment] .. "]"
+ warning_x = warning_x + 0.6
+ end
+ end