1
0
mirror of https://github.com/minetest-mods/intllib.git synced 2025-07-06 18:00:23 +02:00

Add Selected gettext

This commit is contained in:
BrunoMine
2017-07-13 14:23:08 -03:00
parent 7b818cb4af
commit 34c6e8bab4
6 changed files with 123 additions and 9 deletions

View File

@ -178,8 +178,15 @@ function intllib.make_gettext_pair(modname)
or getter(msgid))
return do_replacements(msgstr, ...)
end
gettext_getters[modname] = { gettext_func, ngettext_func }
return gettext_func, ngettext_func
-- Get string of Selected language
local function sgettext_func(lang, msgid, ...)
local scatalogs = gettext.load_catalogs(localedir, lang)
local msgstr = (catgettext(scatalogs, msgid)
or getter(msgid))
return do_replacements(msgstr, ...)
end
gettext_getters[modname] = { gettext_func, ngettext_func, sgettext_func }
return gettext_func, ngettext_func, sgettext_func
end