From e56b564efe888e028e4b01891d9074e8532360d2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 May 2026 21:52:18 -0300 Subject: data, content: additional file artists --- src/data/things/Language.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/data/things/Language.js') diff --git a/src/data/things/Language.js b/src/data/things/Language.js index 2df58d19..5265d851 100644 --- a/src/data/things/Language.js +++ b/src/data/things/Language.js @@ -955,6 +955,7 @@ export class Language extends Thing { const countHelper = (stringKey, optionName = stringKey) => function(value, { unit = false, + unitOnly = false, blankIfZero = false, } = {}) { // Null or undefined value is blank content. @@ -967,22 +968,30 @@ const countHelper = (stringKey, optionName = stringKey) => return html.blank(); } - return this.formatString( - unit + const string = + (unitOnly + ? `count.${stringKey}.unitOnly.` + this.getUnitForm(value) + : unit ? `count.${stringKey}.withUnit.` + this.getUnitForm(value) - : `count.${stringKey}`, - {[optionName]: this.formatNumber(value)}); + : `count.${stringKey}`); + + const options = + (unitOnly + ? {} + : {[optionName]: this.formatNumber(value)}); + + return this.formatString(string, options); }; // TODO: These are hard-coded. Is there a better way? Object.assign(Language.prototype, { - countAdditionalFiles: countHelper('additionalFiles', 'files'), countAlbums: countHelper('albums'), countArtTags: countHelper('artTags', 'tags'), countArtworks: countHelper('artworks'), countCommentaryEntries: countHelper('commentaryEntries', 'entries'), countContributions: countHelper('contributions'), countDays: countHelper('days'), + countFiles: countHelper('files'), countFlashes: countHelper('flashes'), countMonths: countHelper('months'), countTimesFeatured: countHelper('timesFeatured'), -- cgit 1.3.0-6-gf8a5