« get me outta code hell

language list functions - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-10 20:32:26 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-10 20:32:26 -0300
commit2caa1edb5984a17b41a2144e8e59583798bd53e9 (patch)
treef6df6f849bb7386466431b915165c5041cdcd685 /src
parent847b1262bf608cadd59c8d19a564badbd525a6a7 (diff)
language list functions
Diffstat (limited to 'src')
-rw-r--r--src/data/things.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/data/things.js b/src/data/things.js
index 34946c0..4141ec6 100644
--- a/src/data/things.js
+++ b/src/data/things.js
@@ -1543,6 +1543,24 @@ Object.assign(Language.prototype, {
         return this.$('count.words.withUnit.' + this.getUnitForm(value), {words});
     },
 
+    // Conjunction list: A, B, and C
+    formatConjunctionList(array) {
+        this.assertIntlAvailable('intl_listConjunction');
+        return this.intl_listConjunction.format(array);
+    },
+
+    // Disjunction lists: A, B, or C
+    formatDisjunctionList(array) {
+        this.assertIntlAvailable('intl_listDisjunction');
+        return this.intl_listDisjunction.format(array);
+    },
+
+    // Unit lists: A, B, C
+    formatUnitList(array) {
+        this.assertIntlAvailable('intl_listUnit');
+        return this.intl_listUnit.format(array);
+    },
+
     // TODO: These are hard-coded. Is there a better way?
     countAlbums: countHelper('albums'),
     countCommentaryEntries: countHelper('commentaryEntries', 'entries'),