summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/i18n.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-01 12:12:18 +0000
committerSteven Barth <steven@midlink.org>2008-06-01 12:12:18 +0000
commitb454395a8da4013aff2ecd64cd7eafc01fc6a5a2 (patch)
tree0071604ca65f1e520ee2f56b6cf6343bc5297df9 /libs/web/luasrc/i18n.lua
parent1da5feb9f720fd48a886aad09df91bd8cc9df4c8 (diff)
* Performance optimizations
* libs/core: Added bytecode stripping function to luci.util * libs/core: Added smart indexcache that automatically updates cached index-files on change * libs/web: Enabled template caching support * Core Translation part 4
Diffstat (limited to 'libs/web/luasrc/i18n.lua')
-rw-r--r--libs/web/luasrc/i18n.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/web/luasrc/i18n.lua b/libs/web/luasrc/i18n.lua
index 7ace708e9..546429933 100644
--- a/libs/web/luasrc/i18n.lua
+++ b/libs/web/luasrc/i18n.lua
@@ -39,7 +39,7 @@ end
-- Loads a translation and copies its data into the global translation table
function load(file, force)
if force or not loaded[file] then
- local f = loadfile(i18ndir .. file)
+ local f = loadfile(i18ndir..file..".lua") or loadfile(i18ndir..file)
if f then
setfenv(f, table)
f()
@@ -54,8 +54,8 @@ function load(file, force)
end
-- Same as load but autocompletes the filename with .LANG from config.lang
-function loadc(file)
- return load(file .. "." .. require("luci.config").main.lang)
+function loadc(file, force)
+ return load(file .. "." .. require("luci.config").main.lang, force)
end
-- Returns the i18n-value defined by "key" or if there is no such: "default"