From 8346db433f12608495dc9cd1bd27129990810e0e Mon Sep 17 00:00:00 2001 From: dyphire <61936050+dyphire@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:41:17 +0800 Subject: [PATCH] fix: always read romanizations for configured languages (#948) When I originally added this feature, I overlooked that this was actually different from UI localization. It has different usage scenarios: UI main language and romanization files can be separated --- src/uosc/lib/char_conv.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/uosc/lib/char_conv.lua b/src/uosc/lib/char_conv.lua index 8e5183c8..4823ce00 100644 --- a/src/uosc/lib/char_conv.lua +++ b/src/uosc/lib/char_conv.lua @@ -4,13 +4,8 @@ local char_dir = mp.get_script_directory() .. '/char-conv/' local data = {} local languages = get_languages() -for i = #languages, 1, -1 do - lang = languages[i] - if (lang == 'en') then - data = {} - else - table_assign(data, get_locale_from_json(char_dir .. lang:lower() .. '.json')) - end +for _, lang in ipairs(languages) do + table_assign(data, get_locale_from_json(char_dir .. lang:lower() .. '.json')) end local romanization = {}