medic / translation-checker

Check translations from .properties files with Mustache placeholders markup or messageformat syntax.
https://www.npmjs.com/package/@medic/translation-checker
GNU Affero General Public License v3.0
2 stars 0 forks source link

Translations with empty default placeholders throw errors but shouldn't #6

Closed garethbowen closed 2 years ago

garethbowen commented 2 years ago

We allow definition of constants for defaults for when template variables are not found, eg:

contact_name = contact: {{name || 'none'}}

However, if the default string is empty or whitespace then an error is thrown, eg:

contact_name = contact: {{name || ''}}
contact_name = contact: {{name || ' '}}

The workaround is probably to remove the condition altogether (eg: just have {{name}}) but there's nothing invalid about having empty strings, so we should allow them.

garethbowen commented 2 years ago

Released in 1.0.1