Skip to content
Snippets Groups Projects
Verified Commit 75cd173c authored by Karel Koci's avatar Karel Koci :metal:
Browse files

lists: fix and improve even more Luci l18n support

parent 7b870ff4
Branches
Tags
No related merge requests found
......@@ -8,29 +8,28 @@ forInstall(luci,base,proto-ipv6,proto-ppp,app-commands)
--[[
All packages with localization packages
Generated using:
curl https://repo.turris.cz/hbd/omnia/packages/luci/Packages | sed -n 's/^Package: luci-i18n-\([^-]\+\).*/\1/p' | sort | uniq | sed 's/^/"/;s/$/",/'
curl https://repo.turris.cz/hbd/omnia/packages/luci/Packages | sed -n '/Package: luci-i18n-/,/^$/{ s/Depends:.*luci-app-\([^ ,]\+\).*/\1/p }' | sort | uniq | sed 's/^/"/;s/$/",/'
]]
local luci_i18n_pkgs = {
local luci_apps = {
"adblock",
"advanced",
"advanced-reboot",
"ahcp",
"aria2",
"base",
"bcp38",
"clamav",
"commands",
"ddns",
"diag",
"dnscrypt",
"diag-core",
"dnscrypt-proxy",
"dynapoint",
"firewall",
"fwknopd",
"hd",
"hd-idle",
"https_dns_proxy",
"minidlna",
"mjpg",
"mjpg-streamer",
"mwan3",
"nft",
"nft-qos",
"nlbwmon",
"noddos",
"ntpc",
......@@ -45,12 +44,12 @@ local luci_i18n_pkgs = {
"qos",
"radicale",
"radicale2",
"rp",
"rp-pppoe-server",
"samba",
"samba4",
"shadowsocks",
"shadowsocks-libev",
"shairplay",
"simple",
"simple-adblock",
"splash",
"statistics",
"tinyproxy",
......@@ -67,15 +66,63 @@ local luci_i18n_pkgs = {
"wol",
}
--[[
Some packages have separate EN support. This is only few packages so we list them
instead of having warning for multiple packages missing.
Generated using:
curl https://repo.turris.cz/hbd/omnia/packages/luci/Packages | sed -n 's/^Package: luci-i18n-\(.*\)-en.*/\1/p' | sort | sed 's/^/["/;s/$/"] = true,/'
]]
local luci_i18n_en = {
["ahcp"] = true,
["base"] = true,
["commands"] = true,
["diag-core"] = true,
["firewall"] = true,
["fwknopd"] = true,
["hd-idle"] = true,
["minidlna"] = true,
["ntpc"] = true,
["nut"] = true,
["olsr"] = true,
["openvpn"] = true,
["opkg"] = true,
["p910nd"] = true,
["polipo"] = true,
["qos"] = true,
["radicale2"] = true,
["rp-pppoe-server"] = true,
["samba"] = true,
["samba4"] = true,
["splash"] = true,
["statistics"] = true,
["tinyproxy"] = true,
["transmission"] = true,
["uhttpd"] = true,
["upnp"] = true,
["vnstat"] = true,
["watchcat"] = true,
["wol"] = true,
}
if l10n then
local luci_i18n = {["en"] = true} -- we always install English localization
local luci_i18n = {}
for _, lang in pairs(l10n or {}) do
luci_i18n[lang] = true
end
Install("luci-i18n-base-en", { optional = true, priority = 20 })
for lang in pairs(luci_i18n) do
for _, pkg in pairs(luci_i18n_pkgs) do
Install("luci-i18n-" .. pkg .. "-" .. lang, { optional = true, priority = 20 })
Install("luci-i18n-base-" .. lang, { optional = true, priority = 20 })
end
for _, app in pairs(luci_i18n_pkgs) do
if installed["luci-app-" .. app] then
if luci_i18n_en[app] then
Install("luci-i18n-" .. app .. "-en", { optional = true, priority = 20 })
end
for lang in pairs(luci_i18n) do
Install("luci-i18n-" .. app .. "-" .. lang, { optional = true, priority = 20 })
end
end
end
end
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment