From fed5073bd23e893dbfa304f87d7687acd165b502 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Thu, 28 Nov 2019 06:22:18 -0800 Subject: [PATCH] luci-app-qbittorrent: zh-cn po --- package/lean/luci-app-qbittorrent/Makefile | 2 +- .../luasrc/model/cbi/qbittorrent.lua | 99 +++++++++---------- .../luasrc/view/qbittorrent/qbt_value.htm | 36 ------- .../po/zh-cn/qbittorrent.po | 23 ++++- 4 files changed, 72 insertions(+), 88 deletions(-) delete mode 100644 package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbt_value.htm diff --git a/package/lean/luci-app-qbittorrent/Makefile b/package/lean/luci-app-qbittorrent/Makefile index ccca6c75d6..2f8704b539 100644 --- a/package/lean/luci-app-qbittorrent/Makefile +++ b/package/lean/luci-app-qbittorrent/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for qBittorrent LUCI_DEPENDS:=+qBittorrent +python LUCI_PKGARCH:=all PKG_VERSION=1.0 -PKG_RELEASE:=13 +PKG_RELEASE:=17 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua b/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua index 60fa83c5d2..7431394f24 100644 --- a/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua +++ b/package/lean/luci-app-qbittorrent/luasrc/model/cbi/qbittorrent.lua @@ -1,11 +1,11 @@ -local e=require"luci.model.uci".cursor() -local o=e:get_first("qbittorrent","main","Port") or 8080 + +local o=luci.sys.exec("uci get qbittorrent.main.Port | xargs echo -n") or 8080 local a=(luci.sys.call("pidof qbittorrent-nox > /dev/null")==0) local t="" if a then -t="

" +t="

" end function titlesplit(Value) @@ -27,43 +27,25 @@ for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do o:value(u) end -o = s:taboption("basic", Value, "profile", translate("Parent Path for Profile Folder"), translate("The path for storing profile folder using by command: --profile [PATH].")) +o = s:taboption("basic", Value, "profile", translate("Store configuration files in the Path")) o.default = '/tmp' -o = s:taboption("basic", Value, "configuration", translate("Profile Folder Suffix"), translate("Suffix for profile folder, for example, qBittorrent_[NAME].")) +o = s:taboption("basic", Value, "SavePath", translate("Store download files in the Path")) +o.placeholder = "/tmp/download" -o = s:taboption("basic", Value, "Locale", translate("Locale Language")) -o:value("en", translate("English")) -o:value("zh", translate("Chinese")) -o.default = "en" +o = s:taboption("basic", Value, "Port", translate("WEBUI listening port")) +o.datatype = "port" +o.placeholder = "8080" -o = s:taboption("basic", Flag, "Enabled", translate("Enable Log"), translate("Enable logger to log file.")) +o = s:taboption("basic", Flag, "UseRandomPort", translate("Use Random Port"), translate("Randomly assigns a different port every time qBittorrent starts up")) o.enabled = "true" o.disabled = "false" o.default = o.enabled -o = s:taboption("basic", Value, "Path", translate("Log Path"), translate("The path for qbittorrent log.")) -o:depends("Enabled", "true") +o = s:taboption("basic", Value, "PortRangeMin", translate("Connection Port"), translate("Incoming connection port")) +o:depends("UseRandomPort", false) +o.datatype = "range(1024,65535)" -o = s:taboption("basic", Flag, "Backup", translate("Enable Backup"), translate("Backup log file when oversize the given size.")) -o:depends("Enabled", "true") -o.enabled = "true" -o.disabled = "false" -o.default = o.enabled - -o = s:taboption("basic", Flag, "DeleteOld", translate("Delete Old Backup"), translate("Delete the old log file.")) -o:depends("Enabled", "true") -o.enabled = "true" -o.disabled = "false" -o.default = o.enabled - -o = s:taboption("basic", Value, "MaxSizeBytes", translate("Log Max Size"), translate("The max size for qbittorrent log (Unit: Bytes).")) -o:depends("Enabled", "true") -o.placeholder = "66560" - -o = s:taboption("basic", Value, "SaveTime", translate("Log Saving Period"), translate("The log file will be deteted after given time. 1d -- 1 day, 1m -- 1 month, 1y -- 1 year")) -o:depends("Enabled", "true") -o.datatype = "string" s:tab("connection", translate("Connection Settings")) @@ -73,17 +55,6 @@ o.enabled = "true" o.disabled = "false" o.default = o.enabled -o = s:taboption("connection", Flag, "UseRandomPort", translate("Use Random Port"), translate("Use different port on each startup voids the first" - .. " option, and randomly assigns a different port every time qBittorrent starts up.")) -o.enabled = "true" -o.disabled = "false" -o.default = o.enabled - -o = s:taboption("connection", Value, "PortRangeMin", translate("Connection Port"), translate("Generate Randomly")) -o:depends("UseRandomPort", false) -o.datatype = "range(1024,65535)" -o.template = "qbittorrent/qbt_value" -o.btnclick = "randomToken();" o = s:taboption("connection", Value, "GlobalDLLimit", translate("Global Download Speed"), translate("Global Download Speed Limit(KiB/s).")) o.datatype = "float" @@ -109,7 +80,7 @@ o.default = "Both" o = s:taboption("connection", Value, "InetAddress", translate("Inet Address"), translate("The address that respond to the trackers.")) -s:tab("downloads", translate("Downloads Settings")) +s:tab("downloads", translate("Download Settings")) o = s:taboption("downloads", Flag, "CreateTorrentSubfolder", translate("Create Subfolder"), translate("Create subfolder for torrents with multiple files.")) o.enabled = "true" @@ -136,9 +107,6 @@ o.enabled = "true" o.disabled = "false" o.default = o.disabled -o = s:taboption("downloads", Value, "SavePath", translate("Save Path")) -o.placeholder = "/tmp/download" - o = s:taboption("downloads", Flag, "TempPathEnabled", translate("Temp Path Enabled")) o.enabled = "true" o.disabled = "false" @@ -199,7 +167,7 @@ o.enabled = "true" o.disabled = "false" o.default = o.disabled -o = s:taboption("bittorrent", Flag, "uTP_rate_limited", translate("uTP Rate Limit"), translate("Apply rate limit to µTP protocol.")) +o = s:taboption("bittorrent", Flag, "uTP_rate_limited", translate("uTP Rate Limit"), translate("Apply rate limit to μTP protocol.")) o.enabled = "true" o.disabled = "false" o.default = o.enabled @@ -287,9 +255,10 @@ o.placeholder = "admin" o = s:taboption("webgui", Value, "Password", translate("Password"), translate("The login password for WebUI.")) o.password = true -o = s:taboption("webgui", Value, "Port", translate("Listen Port"), translate("The listening port for WebUI.")) -o.datatype = "port" -o.placeholder = "8080" +o = s:taboption("webgui", Value, "Locale", translate("Locale Language")) +o:value("en", translate("English")) +o:value("zh", translate("Chinese")) +o.default = "en" o = s:taboption("webgui", Flag, "CSRFProtection", translate("CSRF Protection"), translate("Enable Cross-Site Request Forgery (CSRF) protection.")) o.enabled = "true" @@ -332,6 +301,8 @@ o.enabled = "true" o.disabled = "false" o.default = o.disabled +o = s:taboption("advanced", Value, "configuration", translate("Profile Folder Suffix"), translate("Suffix for profile folder")) + o = s:taboption("advanced", Flag, "IncludeOverhead", translate("Limit Overhead Usage"), translate("The overhead usage is been limitted.")) o.enabled = "true" o.disabled = "false" @@ -369,4 +340,32 @@ o.enabled = "true" o.disabled = "false" o.default = o.enabled +o = s:taboption("advanced", Flag, "Enabled", translate("Enable Log"), translate("Enable logger to log file.")) +o.enabled = "true" +o.disabled = "false" +o.default = o.enabled + +o = s:taboption("advanced", Value, "Path", translate("Log Path"), translate("The path for qbittorrent log.")) +o:depends("Enabled", "true") + +o = s:taboption("advanced", Flag, "Backup", translate("Enable Backup"), translate("Backup log file when oversize the given size.")) +o:depends("Enabled", "true") +o.enabled = "true" +o.disabled = "false" +o.default = o.enabled + +o = s:taboption("advanced", Flag, "DeleteOld", translate("Delete Old Backup"), translate("Delete the old log file.")) +o:depends("Enabled", "true") +o.enabled = "true" +o.disabled = "false" +o.default = o.enabled + +o = s:taboption("advanced", Value, "MaxSizeBytes", translate("Log Max Size"), translate("The max size for qbittorrent log (Unit: Bytes).")) +o:depends("Enabled", "true") +o.placeholder = "66560" + +o = s:taboption("advanced", Value, "SaveTime", translate("Log Saving Period"), translate("The log file will be deteted after given time. 1d -- 1 day, 1m -- 1 month, 1y -- 1 year")) +o:depends("Enabled", "true") +o.datatype = "string" + return m diff --git a/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbt_value.htm b/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbt_value.htm deleted file mode 100644 index 001625a7f4..0000000000 --- a/package/lean/luci-app-qbittorrent/luasrc/view/qbittorrent/qbt_value.htm +++ /dev/null @@ -1,36 +0,0 @@ -<%# - Copyright 2019 xxx - Licensed to the public under the Apache License 2.0. --%> - -
" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> - <%- if self.title and #self.title > 0 then -%> - -
- <%- end -%> - /> - <% if self.description and #self.description > 0 then -%> -
- " type="button"<%= - attr("value", self.description) .. - ifattr(self.btnclick, "onclick", self.btnclick) - %> /> -
- <%- end %> - <%- if self.title and #self.title > 0 then -%> -
- <%- end -%> -
diff --git a/package/lean/luci-app-qbittorrent/po/zh-cn/qbittorrent.po b/package/lean/luci-app-qbittorrent/po/zh-cn/qbittorrent.po index 51013dab4f..b20a6b8474 100644 --- a/package/lean/luci-app-qbittorrent/po/zh-cn/qbittorrent.po +++ b/package/lean/luci-app-qbittorrent/po/zh-cn/qbittorrent.po @@ -50,4 +50,25 @@ msgid "WEBUI Settings" msgstr "WEBUI设置" msgid "WEBUI listening port" -msgstr "WEBUI监听端口" +msgstr "WebUI 监听端口" + +msgid "Use Random Port" +msgstr "随机传入连接端口" + +msgid "Randomly assigns a different port every time qBittorrent starts up" +msgstr "在每次启动时使用不同的传入连接端口" + +msgid "Connection Port" +msgstr "用于传入连接的端口" + +msgid "Incoming connection port" +msgstr "推荐在防火墙 -> 流量规则 中,打开这个端口获得更好的下载速度( TCP+UDP )" + +msgid "Bittorrent Settings" +msgstr "Bittorrent 设置" + +msgid "WebUI Settings" +msgstr "WebUI 设置" + +msgid "Advance Settings" +msgstr "高级设置"