luci-base: cbi.js: handle translation contexts in _()
authorJo-Philipp Wich <jo@mein.io>
Fri, 14 Feb 2020 07:42:04 +0000 (08:42 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5258080ce32b973e80111abd41fec82bf9b5e31e)

modules/luci-base/htdocs/luci-static/resources/cbi.js

index 3150e393fe8ca41595d3abb7ee8e57da3258536b..92c41515fb3d166a75600b9043ef4f325c1301c9 100644 (file)
@@ -101,7 +101,8 @@ function trimws(s) {
 }
 
 function _(s, c) {
-       return (window.TR && TR[sfh(trimws(s))]) || s;
+       var k = (c != null ? trimws(c) + '\u0001' : '') + trimws(s);
+       return (window.TR && TR[sfh(k)]) || s;
 }
 
 function N_(n, s, p, c) {