« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/language.js10
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)