1
0
mirror of https://github.com/minetest-mods/intllib.git synced 2024-11-16 07:20:30 +01:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Maksim
6ebdc5388d
Add modname.lang.tr locales support (#32) 2021-02-23 18:11:54 +01:00
rubenwardy
016f8af977
Change deprecation title to be clearer 2020-03-09 15:50:22 +00:00
rubenwardy
e00f711d29
Deprecate intllib 2020-03-09 15:48:28 +00:00
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,14 @@
# Internationalization Lib for Minetest # Internationalization Lib for Minetest
## DEPRECATED - Use Minetest's new translation API instead!
You should not use this mod when writing new mods, and you should update mods to no longer depend on this mod.
Minetest 5.0 has builtin support for client-side translation, accessed by `minetest.get_translator()`
## Aboud
By Diego Martínez (kaeza). By Diego Martínez (kaeza).
Released under Unlicense. See `LICENSE.md` for details. Released under Unlicense. See `LICENSE.md` for details.

View File

@ -201,7 +201,8 @@ function intllib.get_strings(modname, langcode)
local modpath = minetest.get_modpath(modname) local modpath = minetest.get_modpath(modname)
msgstr = { } msgstr = { }
for _, l in ipairs(get_locales(langcode)) do 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 for k, v in pairs(t) do
msgstr[k] = msgstr[k] or v msgstr[k] = msgstr[k] or v
end end