summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-01-16 18:10:04 +0100
committerJo-Philipp Wich <jo@mein.io>2020-01-16 18:17:09 +0100
commitaca2c4ba4e4c847e5ae86e5539537f213678a0f3 (patch)
tree30830c696210ce9da49009d4274330c1e7b5eda7
parent3eeb9ef303742430f7358c1a0b57a61aa7c00fa9 (diff)
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 <jo@mein.io>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js2
1 files changed, 1 insertions, 1 deletions
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;
}