diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-16 18:10:04 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-16 18:17:09 +0100 |
commit | aca2c4ba4e4c847e5ae86e5539537f213678a0f3 (patch) | |
tree | 30830c696210ce9da49009d4274330c1e7b5eda7 /modules/luci-base | |
parent | 3eeb9ef303742430f7358c1a0b57a61aa7c00fa9 (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>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 2 |
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 4c3128bfd1..ff198027e3 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; } |