feat: internationalization (#518)

Adds `languages` option to specify localization language priority.
Built in languages can be found in `scripts/uosc_shared/intl`.
This commit is contained in:
natural-harmonia-gropius
2023-04-24 17:37:58 +08:00
committed by GitHub
parent f274101fbd
commit 3c70ffd927
7 changed files with 156 additions and 34 deletions

View File

@@ -65,7 +65,7 @@ function Controls:init()
for i, item in ipairs(items) do
local config = shorthands[item.config] and shorthands[item.config] or item.config
local config_tooltip = split(config, ' *%? *')
local tooltip = config_tooltip[2]
local tooltip = t(config_tooltip[2])
config = shorthands[config_tooltip[1]]
and split(shorthands[config_tooltip[1]], ' *%? *')[1] or config_tooltip[1]
local config_badge = split(config, ' *# *')