Codebase list minetest-mod-intllib / upstream/20180811+git20210223.1.6ebdc53
Import upstream version 20180811+git20210223.1.6ebdc53 Debian Janitor 2 years ago
2 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00
11 # 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
210
311 By Diego Martínez (kaeza).
412 Released under Unlicense. See `LICENSE.md` for details.
200200 local modpath = minetest.get_modpath(modname)
201201 msgstr = { }
202202 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 { }
204205 for k, v in pairs(t) do
205206 msgstr[k] = msgstr[k] or v
206207 end