diff options
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/things/language.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js index 88f16ecb..e9aa58be 100644 --- a/src/data/things/language.js +++ b/src/data/things/language.js @@ -871,12 +871,20 @@ export class Language extends Thing { } const countHelper = (stringKey, optionName = stringKey) => - function(value, {unit = false} = {}) { + function(value, { + unit = false, + blankIfZero = false, + } = {}) { // Null or undefined value is blank content. if (value === null || value === undefined) { return html.blank(); } + // Zero is blank content, if that option is set. + if (value === 0 && blankIfZero) { + return html.blank(); + } + return this.formatString( unit ? `count.${stringKey}.withUnit.` + this.getUnitForm(value) |