mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Refactored to use strictly locals
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
|
||||
lua_gettext.init("./i18n", "koreader")
|
||||
|
||||
local GetText = {}
|
||||
local GetText_mt = {}
|
||||
|
||||
function _(string)
|
||||
function GetText_mt.__call(gettext, string)
|
||||
return lua_gettext.translate(string)
|
||||
end
|
||||
|
||||
function gettextChangeLang(new_lang)
|
||||
function GetText.changeLang(new_lang)
|
||||
lua_gettext.change_lang(new_lang)
|
||||
end
|
||||
|
||||
setmetatable(GetText, GetText_mt)
|
||||
|
||||
return GetText
|
||||
|
||||
Reference in New Issue
Block a user