mirror of
https://github.com/minetest-mods/intllib.git
synced 2025-12-22 01:15:33 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ebdc5388d | ||
|
|
016f8af977 | ||
|
|
e00f711d29 |
@@ -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.
|
||||||
|
|
||||||
|
|||||||
3
init.lua
3
init.lua
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user