Platform: Raspberry Pi 4
Node Version: 10.23.0
MagicMirror Version: 2.13.0
Description: In translator.js, the code checks whether a variable is present with the following code:
return variables[varName] || "{" + varName + "}";
However, when the content of the variable is an empty string, this erroneously substitutes {varName} back in.
Steps to Reproduce: Call this.translate("something with {VAR}", {VAR: ""})
Expected Results: If the variable is present with the empty string, the empty string should be substituted. This could be achieved by using return varName in variables ? variables[varName] : "{" + varName + "}"; instead.
Actual Results: Variable is not subsituted
Platform: Raspberry Pi 4
Node Version: 10.23.0
MagicMirror Version: 2.13.0
Description: In translator.js, the code checks whether a variable is present with the following code:
However, when the content of the variable is an empty string, this erroneously substitutes
{varName}back in.Steps to Reproduce: Call
this.translate("something with {VAR}", {VAR: ""})Expected Results: If the variable is present with the empty string, the empty string should be substituted. This could be achieved by using
return varName in variables ? variables[varName] : "{" + varName + "}";instead.Actual Results: Variable is not subsituted