Skip to content

Commit

Permalink
luci-base: dispatcher.uc: fix N_() fallback implementation
Browse files Browse the repository at this point in the history
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 <jo@mein.io>
  • Loading branch information
jow- committed Aug 7, 2023
1 parent a435d4e commit 107ed06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/luci-base/ucode/dispatcher.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 107ed06

Please sign in to comment.