luci-app-vpnbypass: better localizeable resources 4002/head
authorStan Grishin <stangri@melmac.net>
Sat, 2 May 2020 22:17:49 +0000 (22:17 +0000)
committerStan Grishin <stangri@melmac.net>
Sun, 3 May 2020 09:12:22 +0000 (09:12 +0000)
Signed-off-by: Stan Grishin <stangri@melmac.net>
applications/luci-app-vpnbypass/Makefile
applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua
applications/luci-app-vpnbypass/po/templates/vpnbypass.pot

index cfcafec05b608e1c8e312cb1d9c4b4201b136050..27952449351a2af98d0a2fef6028c76576e7c9a3 100644 (file)
@@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI
 LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
 LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpnbypass
 LUCI_PKGARCH:=all
-PKG_RELEASE:=16
+PKG_RELEASE:=19
 
 include ../../luci.mk
 
index 77753020d00029510697c95ef84e1ab102b4191c..d5f4a8cafd7cefeedfcf5042ef74f0324bd37c8e 100644 (file)
@@ -1,7 +1,10 @@
 module("luci.controller.vpnbypass", package.seeall)
 function index()
        if nixio.fs.access("/etc/config/vpnbypass") then
-               entry({"admin", "vpn"}, firstchild(), _("VPN"), 60).dependent=false
+               local e = entry({"admin", "vpn"}, firstchild(), _("VPN"), 60)
+               e.dependent = false
+               e.acl_depends = { "luci-app-vpnbypass" }
+
                entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
                entry({"admin", "vpn", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
        end
index 0afdd7b0e1f8c9ab4d2eb5b29503e2e9565a8dce..8a70bd1bb9cdfe94b49ab2249fc01fa8b8f9f025 100644 (file)
@@ -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
index 8778dc228d01e20a87001f61dfe272bb3c05af9e..56f03560ffcc1748ed80f2643c88364aca57ff1d 100644 (file)
@@ -1,16 +1,26 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=UTF-8"
 
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:26
+msgid "%s (disabled)"
+msgstr ""
+
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:10
+msgid "%s is not installed or not found"
+msgstr ""
+
 #: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:57
 msgid "Disable"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:77
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:74
 msgid "Domains to Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:78
-msgid "Domains to be accessed directly (outside of the VPN tunnel), see"
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:75
+msgid ""
+"Domains to be accessed directly (outside of the VPN tunnel), see %sREADME%s "
+"for syntax"
 msgstr ""
 
 #: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:54
@@ -21,43 +31,39 @@ msgstr ""
 msgid "Loading"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:60
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:57
 msgid "Local IP Addresses to Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:60
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:57
 msgid ""
 "Local IP addresses or subnets with direct internet access (outside of the "
 "VPN tunnel)"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:46
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:43
 msgid "Local Ports to Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:46
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:43
 msgid "Local ports to trigger VPN Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:80
-msgid "README"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:67
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:64
 msgid "Remote IP Addresses to Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:67
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:64
 msgid ""
 "Remote IP addresses or subnets which will be accessed directly (outside of "
 "the VPN tunnel)"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:53
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:50
 msgid "Remote Ports to Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:53
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:50
 msgid "Remote ports to trigger VPN Bypass"
 msgstr ""
 
@@ -65,15 +71,18 @@ msgstr ""
 msgid "Restart"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:25
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:22
 msgid "Running"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:35
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:36
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:33
 msgid "Service Status"
 msgstr ""
 
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:32
+msgid "Service Status [%s %s]"
+msgstr ""
+
 #: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:41
 msgid "Start"
 msgstr ""
@@ -82,7 +91,7 @@ msgstr ""
 msgid "Stop"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:27
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:24
 msgid "Stopped"
 msgstr ""
 
@@ -90,26 +99,14 @@ msgstr ""
 msgid "VPN"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua:5
+#: applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua:8
 msgid "VPN Bypass"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:44
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:41
 msgid "VPN Bypass Rules"
 msgstr ""
 
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:33
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:30
 msgid "VPN Bypass Settings"
 msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:29
-msgid "disabled"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:80
-msgid "for syntax"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:11
-msgid "is not installed or not found"
-msgstr ""