Merge pull request #3889 from stangri/master-luci-app-https-dns-proxy

luci-app-https-dns-proxy: improve i18n
This commit is contained in:
Hannu Nyman 2020-04-11 10:49:27 +03:00 committed by GitHub
commit fc05327211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 52 deletions

View file

@ -10,7 +10,7 @@ LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_RELEASE:=3 PKG_RELEASE:=4
include ../../luci.mk include ../../luci.mk

View file

@ -49,24 +49,22 @@ function get_provider_name(value)
return translate("Unknown Provider") return translate("Unknown Provider")
end end
local tmpfsStatus, tmpfsStatusCode local packageStatus, packageStatusCode
local ubusStatus = util.ubus("service", "list", { name = packageName }) local ubusStatus = util.ubus("service", "list", { name = packageName })
local tmpfsVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'"))) local packageVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'"))) or ""
if not tmpfsVersion or tmpfsVersion == "" then if packageVersion == "" then
tmpfsStatusCode = -1 packageStatusCode = -1
tmpfsVersion = "" packageStatus = translatef("%s is not installed or not found", packageName)
tmpfsStatus = packageName .. " " .. translate("is not installed or not found")
else else
tmpfsVersion = " [" .. packageName .. " " .. tmpfsVersion .. "]"
if not ubusStatus or not ubusStatus[packageName] then if not ubusStatus or not ubusStatus[packageName] then
tmpfsStatusCode = 0 packageStatusCode = 0
tmpfsStatus = translate("Stopped") packageStatus = translate("Stopped")
if not luci.sys.init.enabled(packageName) then if not sys.init.enabled(packageName) then
tmpfsStatus = tmpfsStatus .. " (" .. translate("disabled") .. ")" packageStatus = packageStatus .. " (" .. translate("disabled") .. ")"
end end
else else
tmpfsStatusCode, tmpfsStatus = 1, "" packageStatusCode, packageStatus = 1, ""
for n = 1,1000 do for n = 1,1000 do
if ubusStatus and ubusStatus[packageName] and if ubusStatus and ubusStatus[packageName] and
ubusStatus[packageName]["instances"] and ubusStatus[packageName]["instances"] and
@ -83,7 +81,7 @@ else
end end
la = la or "127.0.0.1" la = la or "127.0.0.1"
lp = lp or n + 5053 lp = lp or n + 5053
tmpfsStatus = tmpfsStatus .. translate("Running") .. ": " .. get_provider_name(url) .. " " .. translate("DoH") .. " " .. translate("at") .. " " .. la .. ":" .. lp .. "\n" packageStatus = packageStatus .. translatef("Running: %s DoH at %s:%s", get_provider_name(url), la, lp) .. "\n"
else else
break break
end end
@ -93,27 +91,26 @@ end
m = Map("https-dns-proxy", translate("DNS Over HTTPS Proxy Settings")) m = Map("https-dns-proxy", translate("DNS Over HTTPS Proxy Settings"))
h = m:section(TypedSection, "_dummy", translate("Service Status") .. tmpfsVersion) h = m:section(TypedSection, "_dummy", translatef("Service Status [%s %s]", packageName, packageVersion))
h.template = "cbi/nullsection" h.template = "cbi/nullsection"
ss = h:option(DummyValue, "_dummy", translate("Service Status")) ss = h:option(DummyValue, "_dummy", translate("Service Status"))
if tmpfsStatusCode == -1 then if packageStatusCode == -1 then
ss.template = packageName .. "/status" ss.template = packageName .. "/status"
ss.value = tmpfsStatus ss.value = packageStatus
else else
if tmpfsStatusCode == 0 then if packageStatusCode == 0 then
ss.template = packageName .. "/status" ss.template = packageName .. "/status"
else else
ss.template = packageName .. "/status-textarea" ss.template = packageName .. "/status-textarea"
end end
ss.value = tmpfsStatus ss.value = packageStatus
buttons = h:option(DummyValue, "_dummy") buttons = h:option(DummyValue, "_dummy")
buttons.template = packageName .. "/buttons" buttons.template = packageName .. "/buttons"
end end
create_helper_text() create_helper_text()
s3 = m:section(TypedSection, "https-dns-proxy", translate("Instances"), translate("When you add/remove any instances below, they will be used to override the 'DNS forwardings' section of ") s3 = m:section(TypedSection, "https-dns-proxy", translate("Instances"),
.. [[ <a href="]] .. dispatcher.build_url("admin/network/dhcp") .. [[">]] translatef("When you add/remove any instances below, they will be used to override the 'DNS forwardings' section of <a href=\"%s\">DHCP and DNS</a>.", dispatcher.build_url("admin/network/dhcp")) .. helperText)
.. translate("DHCP and DNS") .. [[</a>]] .. "." .. helperText)
s3.template = "cbi/tblsection" s3.template = "cbi/tblsection"
s3.sortable = false s3.sortable = false
s3.anonymous = true s3.anonymous = true

View file

@ -1,6 +1,10 @@
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:59
msgid "%s is not installed or not found"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/com.adguard.dns-family.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/com.adguard.dns-family.lua:3
msgid "AdGuard (Family Protection)" msgid "AdGuard (Family Protection)"
msgstr "" msgstr ""
@ -25,15 +29,11 @@ msgstr ""
msgid "Cloudflare" msgid "Cloudflare"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:116
msgid "DHCP and DNS"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua:4 #: applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua:4
msgid "DNS Over HTTPS Proxy" msgid "DNS Over HTTPS Proxy"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:94 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:93
msgid "DNS Over HTTPS Proxy Settings" msgid "DNS Over HTTPS Proxy Settings"
msgstr "" msgstr ""
@ -49,11 +49,7 @@ msgstr ""
msgid "Disable" msgid "Disable"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:86 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:164
msgid "DoH"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:166
msgid "EDNS client subnet" msgid "EDNS client subnet"
msgstr "" msgstr ""
@ -69,7 +65,7 @@ msgstr ""
msgid "Google" msgid "Google"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:114 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:113
msgid "Instances" msgid "Instances"
msgstr "" msgstr ""
@ -81,11 +77,11 @@ msgstr ""
msgid "LibreDNS (No Ads)" msgid "LibreDNS (No Ads)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:149 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:147
msgid "Listen address" msgid "Listen address"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:162 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:160
msgid "Listen port" msgid "Listen port"
msgstr "" msgstr ""
@ -97,7 +93,7 @@ msgstr ""
msgid "ODVR (nic.cz)" msgid "ODVR (nic.cz)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:169 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:167
msgid "Proxy server" msgid "Proxy server"
msgstr "" msgstr ""
@ -121,19 +117,22 @@ msgstr ""
msgid "Reload" msgid "Reload"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:122 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:120
msgid "Resolver" msgid "Resolver"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:86 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:85
msgid "Running" msgid "Running: %s DoH at %s:%s"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:96 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:97
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:98
msgid "Service Status" msgid "Service Status"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:95
msgid "Service Status [%s %s]"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:41 #: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:41
msgid "Start" msgid "Start"
msgstr "" msgstr ""
@ -142,7 +141,7 @@ msgstr ""
msgid "Stop" msgid "Stop"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:64 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:63
msgid "Stopped" msgid "Stopped"
msgstr "" msgstr ""
@ -153,25 +152,17 @@ msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:114 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:114
msgid "" msgid ""
"When you add/remove any instances below, they will be used to override the " "When you add/remove any instances below, they will be used to override the "
"'DNS forwardings' section of" "'DNS forwardings' section of <a href=\"%s\">DHCP and DNS</a>."
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:34 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:34
msgid "and" msgid "and"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:86 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:65
msgid "at"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:66
msgid "disabled" msgid "disabled"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:59
msgid "is not installed or not found"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers.disabled/cn.rubyfish.dns.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers.disabled/cn.rubyfish.dns.lua:3
msgid "rubyfish.cn" msgid "rubyfish.cn"
msgstr "" msgstr ""