projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3eeb9ef
)
luci-base: cbi.js: collapse whitespace before language string hashing
author
Jo-Philipp Wich
<jo@mein.io>
Thu, 16 Jan 2020 17:10:04 +0000
(18:10 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Thu, 16 Jan 2020 17:17:09 +0000
(18:17 +0100)
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>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 4c3128bfd12272027c9f4deca9b6e7068086a18d..ff198027e37df4dd7f72f7dec6fe881e62bf3752 100644
(file)
--- 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;
}