luci-base: cbi.js: handle translation contexts in _()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5258080ce3)
This commit is contained in:
Jo-Philipp Wich 2020-02-14 08:42:04 +01:00
parent c952ef38d2
commit 0633974a26

View 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) {