From 107ed061a8b68f080df122770690d513f52eeed0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 7 Aug 2023 23:33:56 +0200 Subject: [PATCH] luci-base: dispatcher.uc: fix `N_()` fallback implementation The fallback implementation of `N_()` accessed the wrong variable, a global `n` instead of the local `args`. Adjust the expression to reference the correct variable. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/ucode/dispatcher.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 831922ac1d6a..7ff34afba963 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -886,7 +886,7 @@ dispatch = function(_http, path) { striptags, entityencode, _: (...args) => translate(...args) ?? args[0], - N_: (...args) => ntranslate(...args) ?? (n[0] == 1 ? n[1] : n[2]), + N_: (...args) => ntranslate(...args) ?? (args[0] == 1 ? args[1] : args[2]), }); try {