1
0
mirror of https://github.com/minetest-mods/intllib.git synced 2025-07-04 17:10:22 +02:00

Fix warnings issued by luacheck.

This commit is contained in:
Diego Martínez
2017-02-11 01:56:54 -03:00
parent c667cd0de6
commit 122d1a83cc
5 changed files with 17 additions and 30 deletions

View File

@ -86,7 +86,7 @@ end
local function catngettext(catalogs, msgid, msgid_plural, n)
n = math.floor(n)
for i, cat in ipairs(catalogs) do
for _, cat in ipairs(catalogs) do
local msgstr = cat and cat[msgid]
if msgstr then
local index = cat.plural_index(n)
@ -107,18 +107,18 @@ function intllib.make_gettext_pair(modname)
local localedir = minetest.get_modpath(modname).."/locale"
local catalogs = gettext.load_catalogs(localedir)
local getter = Getter(modname)
local function gettext(msgid, ...)
local function gettext_func(msgid, ...)
local msgstr = (catgettext(catalogs, msgid)
or getter(msgid))
return do_replacements(msgstr, ...)
end
local function ngettext(msgid, msgid_plural, n, ...)
local function ngettext_func(msgid, msgid_plural, n, ...)
local msgstr = (catngettext(catalogs, msgid, msgid_plural, n)
or getter(msgid))
return do_replacements(msgstr, ...)
end
gettext_getters[modname] = { gettext, ngettext }
return gettext, ngettext
gettext_getters[modname] = { gettext_func, ngettext_func }
return gettext_func, ngettext_func
end