mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-22 19:03:43 +01:00
Fix string len for cyrillic chars
This commit is contained in:
parent
13b4edcc46
commit
24115a0d84
3
init.lua
3
init.lua
@ -1089,7 +1089,8 @@ local function get_rcp_lbl(lang_code, show_usages, unum, rnum, fs, panel, spacin
|
||||
end
|
||||
|
||||
lbl = get_translation(lang_code, lbl)
|
||||
local shift = min(0.9, abs(13 - max(13, #lbl)) * 0.1)
|
||||
local lbl_len = #(lbl):gsub("[\128-\191]", "") -- Count chars, not bytes in UTF-8 strings
|
||||
local shift = min(0.9, abs(13 - max(13, lbl_len)) * 0.1)
|
||||
|
||||
fs[#fs + 1] = fmt(FMT.label,
|
||||
XOFFSET + (sfinv_only and 2.3 or 1.6) - shift,
|
||||
|
Loading…
Reference in New Issue
Block a user