summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-11-05 16:17:19 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-11-05 16:17:19 +0000
commit42f9bd6388ef451495e8a17c7742f0987b91cab1 (patch)
treebe6259f9ba2a190175e976d497d80112aab3d842 /lib
parent2f84918b14e34a5b5679524878a47c0976e972cb (diff)
downloadgitano-42f9bd6388ef451495e8a17c7742f0987b91cab1.tar.gz
Soft-load the gitano.util module
Diffstat (limited to 'lib')
-rw-r--r--lib/gitano/i18n.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/gitano/i18n.lua b/lib/gitano/i18n.lua
index 0cf5c9c..4b5198e 100644
--- a/lib/gitano/i18n.lua
+++ b/lib/gitano/i18n.lua
@@ -8,7 +8,13 @@
local tongue = require "tongue"
-local util = require "gitano.util"
+local _util = nil
+local function util()
+ if _util == nil then
+ _util = require "gitano.util"
+ end
+ return _util
+end
local basepath, pluginpaths = nil, {}
@@ -20,7 +26,7 @@ local codex = nil
local function get_base_lang(lang, sublang)
if sublang then lang = lang .. "_" .. sublang end
- local fh = io.open(util.path_join(basepath, lang .. ".parent"), "r")
+ local fh = io.open(util().path_join(basepath, lang .. ".parent"), "r")
if fh then
local parent = fh:read("*a"):gsub("\n", "")
fh:close()
@@ -38,7 +44,7 @@ local function new_gitano_pack(codex, lang, sublang)
end
local function base_packloader(codex, pack, fulllang)
- local chunk, err = loadfile(util.path_join(basepath, fulllang .. ".lua"))
+ local chunk, err = loadfile(util().path_join(basepath, fulllang .. ".lua"))
if chunk then
local ok, tab = pcall(chunk)
if ok and type(tab) == "table" then