mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #2393 from MikeBishop/translator_falsy_vars
Permit substituting a falsy value in translator variables
This commit is contained in:
commit
353cc3b00f
@ -58,6 +58,7 @@ _This release is scheduled to be released on 2021-01-01._
|
|||||||
- update node-ical version again, 0.12.5, change RRULE fix (#2371, #2379)
|
- update node-ical version again, 0.12.5, change RRULE fix (#2371, #2379)
|
||||||
- Added missing function call in module.show()
|
- Added missing function call in module.show()
|
||||||
- remove undefined objects from modules array (#2382)
|
- remove undefined objects from modules array (#2382)
|
||||||
|
- Translator variables can have falsy values (e.g. empty string)
|
||||||
|
|
||||||
## [2.13.0] - 2020-10-01
|
## [2.13.0] - 2020-10-01
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ var Translator = (function () {
|
|||||||
template = variables.fallback;
|
template = variables.fallback;
|
||||||
}
|
}
|
||||||
return template.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) {
|
return template.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) {
|
||||||
return variables[varName] || "{" + varName + "}";
|
return varName in variables ? variables[varName] : "{" + varName + "}";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user