From c7ae481557a8d83fb669c1bac9baeca7d188a52b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
Date: Tue, 9 Jul 2019 17:30:44 +0200
Subject: [PATCH] lists/luci: fix and use for_l10n instead of for loop

---
 lists/luci.lua.m4 | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/lists/luci.lua.m4 b/lists/luci.lua.m4
index 2ddd25a11..9cb4a0f77 100644
--- a/lists/luci.lua.m4
+++ b/lists/luci.lua.m4
@@ -104,25 +104,16 @@ local luci_i18n_en = {
 	["wol"] = true,
 }
 
-if l10n then
-	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
-		Install("luci-i18n-base-" .. lang, { optional = true, priority = 20 })
-	end
+if for_l10n then
+	Install("luci-i18n-base-en", { optional = true })
+	for_l10n("luci-i18n-base-")
 
-	for _, app in pairs(luci_i18n_pkgs) do
+	for _, app in pairs(luci_apps) 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 })
+				Install("luci-i18n-" .. app .. "-en", { optional = true })
 			end
+			for_l10n("luci-i18n-" .. app .. "-")
 		else
 			--[[
 			We are not aware that we should install i18n unless it is installed
-- 
GitLab