From aca2c4ba4e4c847e5ae86e5539537f213678a0f3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Jan 2020 18:10:04 +0100 Subject: [PATCH] luci-base: cbi.js: collapse whitespace before language string hashing To mirror the behavior of the Lua runtime, we need to collapse whitepace in translation source strings before doing the string table lookup. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 4c3128bfd..ff198027e 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -95,7 +95,7 @@ function sfh(s) { } function _(s) { - return (window.TR && TR[sfh(s)]) || s; + return (window.TR && TR[sfh(String(s).trim().replace(/[ \t\n]+/g, ' '))]) || s; } -- 2.25.1