Import upstream version 20180811+git20210223.1.6ebdc53
Debian Janitor
2 years ago
0 | 0 |
|
1 | 1 |
# Internationalization Lib for Minetest
|
|
2 |
|
|
3 |
## DEPRECATED - Use Minetest's new translation API instead!
|
|
4 |
|
|
5 |
You should not use this mod when writing new mods, and you should update mods to no longer depend on this mod.
|
|
6 |
|
|
7 |
Minetest 5.0 has builtin support for client-side translation, accessed by `minetest.get_translator()`
|
|
8 |
|
|
9 |
## Aboud
|
2 | 10 |
|
3 | 11 |
By Diego MartÃnez (kaeza).
|
4 | 12 |
Released under Unlicense. See `LICENSE.md` for details.
|
200 | 200 |
local modpath = minetest.get_modpath(modname)
|
201 | 201 |
msgstr = { }
|
202 | 202 |
for _, l in ipairs(get_locales(langcode)) do
|
203 | |
local t = intllib.load_strings(modpath.."/locale/"..l..".txt") or { }
|
|
203 |
local t = intllib.load_strings(modpath.."/locale/"..modname.."."..l..".tr")
|
|
204 |
or intllib.load_strings(modpath.."/locale/"..l..".txt") or { }
|
204 | 205 |
for k, v in pairs(t) do
|
205 | 206 |
msgstr[k] = msgstr[k] or v
|
206 | 207 |
end
|