summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-openvpn/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-10-10 11:48:04 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-10-10 11:48:04 +0000
commit6bfef156f2cdcb4e01176ffbac7998625414a8e5 (patch)
tree5620069fbbcb8b9b45a57d51d33be79e24a67483 /applications/luci-openvpn/luasrc/model
parentbfb5a53c45453fd59d5ee3eb7d370a27d6ee9147 (diff)
* luci/app/openvpn: add translations, various improvements
Diffstat (limited to 'applications/luci-openvpn/luasrc/model')
-rw-r--r--applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua6
-rw-r--r--applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua7
-rw-r--r--applications/luci-openvpn/luasrc/model/cbi/openvpn.lua18
3 files changed, 21 insertions, 10 deletions
diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
index 40af624b9..b1941e15f 100644
--- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
+++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
@@ -230,7 +230,11 @@ s.anonymous = true
for _, option in ipairs(params) do
- local o = s:option(option[1], option[2])
+ local o = s:option(
+ option[1], option[2],
+ translate("openvpn_param_%s" % option[2]),
+ translate("openvpn_param_%s_desc" % option[2])
+ )
if option[1] == DummyValue then
o.value = option[3]
diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
index 964da447e..cadf558bf 100644
--- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
+++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
@@ -61,7 +61,12 @@ p.instance = arg[1]
local s = m:section( NamedSection, arg[1], "openvpn" )
for _, option in ipairs(basicParams) do
- local o = s:option(option[1], option[2])
+ local o = s:option(
+ option[1], option[2],
+ translate("openvpn_param_%s" % option[2]),
+ translate("openvpn_param_%s_desc" % option[2])
+ )
+
o.optional = true
if option[1] == DummyValue then
diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua
index 22cdcb4d6..863be2f13 100644
--- a/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua
+++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua
@@ -20,8 +20,8 @@ require("luci.model.uci")
local uci = luci.model.uci.cursor()
-local m = Map("openvpn")
-local s = m:section( TypedSection, "openvpn" )
+local m = Map("openvpn", translate("openvpn"))
+local s = m:section( TypedSection, "openvpn", translate("openvpn_overview"), translate("openvpn_overview_desc") )
s.template = "cbi/tblsection"
s.template_addremove = "openvpn/cbi-select-input-add"
s.addremove = true
@@ -70,26 +70,28 @@ function s.create(self, name)
end
-s:option( Flag, "enable" )
+s:option( Flag, "enable", translate("openvpn_enable") )
-local active = s:option( DummyValue, "_active" )
+local active = s:option( DummyValue, "_active", translate("openvpn_active") )
function active.cfgvalue(self, section)
if luci.fs.isfile("/var/run/openvpn_%s.pid" % section) then
local pid = io.lines("/var/run/openvpn_%s.pid" % section)()
if pid and #pid > 0 and tonumber(pid) ~= nil then
- return (luci.sys.process.signal(pid, 0)) and "yes (" .. pid .. ")" or "no"
+ return (luci.sys.process.signal(pid, 0))
+ and translatef("openvpn_active_yes", pid)
+ or translate("openvpn_active_no")
end
end
- return "no"
+ return translate("openvpn_active_no")
end
-local port = s:option( DummyValue, "port" )
+local port = s:option( DummyValue, "port", translate("openvpn_port") )
function port.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "1194"
end
-local proto = s:option( DummyValue, "proto" )
+local proto = s:option( DummyValue, "proto", translate("openvpn_proto") )
function proto.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "udp"