Skip to content

Permit substituting a falsy value in translator variables#2393

Merged
MichMich merged 2 commits intoMagicMirrorOrg:developfrom
MikeBishop:translator_falsy_vars
Dec 31, 2020
Merged

Permit substituting a falsy value in translator variables#2393
MichMich merged 2 commits intoMagicMirrorOrg:developfrom
MikeBishop:translator_falsy_vars

Conversation

@MikeBishop
Copy link
Contributor

Fixes #2389; this no longer evaluates the provided value, merely the presence of the key. That means values which are falsy to JS (empty string, undefined, number 0, etc.) now get substituted where before they didn't.

For some possible values, it's possible that's not what you wanted -- but leaving {VARNAME} in place probably wasn't either, so 🤷‍♂️. It fails differently now. For empty strings, zeros, etc. this fixes a bug.

Copy link
Collaborator

@rejas rejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MichMich MichMich merged commit 353cc3b into MagicMirrorOrg:develop Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants