summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-vpnbypass/luasrc
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.net>2020-05-02 22:17:35 +0000
committerStan Grishin <stangri@melmac.net>2020-05-03 09:07:32 +0000
commitd5422a7cbc424d5da24bce852fbde0e141b53330 (patch)
tree6679fe676a39586c4e23bd408b01596ae3c008e9 /applications/luci-app-vpnbypass/luasrc
parentcd69c118ad04ca36c2530fec225b28ad338a50e9 (diff)
luci-app-vpnbypass: better localizeable resources
Signed-off-by: Stan Grishin <stangri@melmac.net>
Diffstat (limited to 'applications/luci-app-vpnbypass/luasrc')
-rw-r--r--applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua18
1 files changed, 7 insertions, 11 deletions
diff --git a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
index 0afdd7b0e..8a70bd1bb 100644
--- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
+++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
@@ -5,12 +5,9 @@ local util = require "luci.util"
local packageName = "vpnbypass"
local packageVersion, statusText = nil, nil
-packageVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'")))
-if not packageVersion or packageVersion == "" then
- packageVersion = ""
- statusText = packageName .. " " .. translate("is not installed or not found")
-else
- packageVersion = " [" .. packageName .. " " .. packageVersion .. "]"
+packageVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'"))) or ""
+if packageVersion == "" then
+ statusText = translatef("%s is not installed or not found", packageName)
end
local serviceRunning, serviceEnabled = false, false
@@ -26,13 +23,13 @@ if serviceRunning then
else
statusText = translate("Stopped")
if not serviceEnabled then
- statusText = statusText .. " (" .. translate("disabled") .. ")"
+ statusText = translatef("%s (disabled)", statusText)
end
end
m = Map("vpnbypass", translate("VPN Bypass Settings"))
-h = m:section(NamedSection, "config", packageName, translate("Service Status") .. packageVersion)
+h = m:section(NamedSection, "config", packageName, translatef("Service Status [%s %s]", packageName, packageVersion))
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
ss.template = packageName .. "/status"
ss.value = statusText
@@ -75,9 +72,8 @@ d = Map("dhcp")
s4 = d:section(TypedSection, "dnsmasq")
s4.anonymous = true
di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"),
- translate("Domains to be accessed directly (outside of the VPN tunnel), see ")
- .. [[<a href="]] .. readmeURL .. [[#bypass-domains-formatsyntax" target="_blank">]]
- .. translate("README") .. [[</a> ]] .. translate("for syntax"))
+ translatef("Domains to be accessed directly (outside of the VPN tunnel), see %sREADME%s for syntax",
+ "<a href=\"" .. readmeURL .. "#bypass-domains-formatsyntax" .. "\" target=\"_blank\">", "</a>"))
function d.on_after_commit(map)
util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
end