Add `modname.lang.tr` locales support (#32)

This commit is contained in:
Maksim 2021-02-23 18:11:54 +01:00 committed by GitHub
parent 016f8af977
commit 6ebdc5388d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -201,7 +201,8 @@ function intllib.get_strings(modname, langcode)
local modpath = minetest.get_modpath(modname)
msgstr = { }
for _, l in ipairs(get_locales(langcode)) do
local t = intllib.load_strings(modpath.."/locale/"..l..".txt") or { }
local t = intllib.load_strings(modpath.."/locale/"..modname.."."..l..".tr")
or intllib.load_strings(modpath.."/locale/"..l..".txt") or { }
for k, v in pairs(t) do
msgstr[k] = msgstr[k] or v
end