summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-11-01 13:19:03 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-11-01 13:19:03 +0000
commit5f0ecfe984f0e69095a4e888913fe2da38b13ccc (patch)
tree3738408b57db16813e205b576019825d699bf8d4
parenta3cf64006bc32dbfb38f8c083667df0ebfffe04c (diff)
libs/uvl: fix i18n handling for errors
-rw-r--r--libs/uvl/luasrc/uvl/errors.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/libs/uvl/luasrc/uvl/errors.lua b/libs/uvl/luasrc/uvl/errors.lua
index 614100fce..f4147d8b4 100644
--- a/libs/uvl/luasrc/uvl/errors.lua
+++ b/libs/uvl/luasrc/uvl/errors.lua
@@ -85,11 +85,11 @@ for i, v in ipairs(ERRCODES) do
end
-function i18n(key, def)
+function i18n(key)
if luci.i18n then
- return luci.i18n.translate(key,def)
+ return luci.i18n.translate(key)
else
- return def
+ return key
end
end
@@ -130,10 +130,7 @@ end
function error.string(self,pad)
pad = pad or " "
- local str = i18n(
- 'uvl_err_%s' % string.lower(ERRCODES[self.code][1]),
- ERRCODES[self.code][2]
- )
+ local str = i18n(ERRCODES[self.code][2])
:gsub("\n", "\n"..pad)
:gsub("%%i", self:cid())
:gsub("%%I", self:sid())