luci-app-qbittorrent: zh-cn po

This commit is contained in:
LEAN-ESX 2019-11-28 06:22:18 -08:00
parent c4ba9eb960
commit fed5073bd2
4 changed files with 72 additions and 88 deletions

View File

@ -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

View File

@ -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="<br /><br /><input class=\"cbi-button cbi-button-apply\" type=\"submit\" value=\" "..translate("Open Web Interface").." \" onclick=\"window.open('http://'+window.location.hostname+':"..o.."')\"/>"
t="<br /><br /><input class=\"cbi-button cbi-button-apply\" type=\"button\" value=\" "..translate("Open Web Interface").." \" onclick=\"window.open('http://'+window.location.hostname+':"..o.."')\"/>"
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: <b>--profile [PATH]</b>."))
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, <b>qBittorrent_[NAME]</b>."))
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

View File

@ -1,36 +0,0 @@
<%#
Copyright 2019 xxx <xxx@xxx.com>
Licensed to the public under the Apache License 2.0.
-%>
<div class="cbi-value<% if self.error and self.error[section] then %> cbi-value-error<% end %> <% if self.last_child then %> cbi-value-last <% end %>" id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>">
<%- if self.title and #self.title > 0 then -%>
<label class="cbi-value-title"<%= attr("for", cbid) %>><%-=self.title-%></label>
<div class="cbi-value-field">
<%- end -%>
<input data-update="change"<%=
attr("id", cbid) ..
attr("name", cbid) ..
attr("type", self.password and "password" or "text") ..
attr("class", self.password and "cbi-input-password" or "cbi-input-text") ..
attr("value", self:cfgvalue(section) or self.default) ..
ifattr(self.size, "size") ..
ifattr(self.placeholder, "placeholder") ..
ifattr(self.readonly, "readonly") ..
ifattr(self.maxlength, "maxlength") ..
ifattr(self.datatype, "data-type", self.datatype) ..
ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
ifattr(self.onmouseover, "onmouseover")
%> />
<% if self.description and #self.description > 0 then -%>
<div class="cbi-value-description">
<input class="cbi-button cbi-input-<%=self.inputstyle or "button" %>" type="button"<%=
attr("value", self.description) ..
ifattr(self.btnclick, "onclick", self.btnclick)
%> />
</div>
<%- end %>
<%- if self.title and #self.title > 0 then -%>
</div>
<%- end -%>
</div>

View File

@ -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 "高级设置"