From b839fb97415e155ea25b29581fa605fe1f65b5f2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 18 Jun 2022 15:52:22 -0300 Subject: make additional files a counted string --- src/data/things.js | 1 + src/misc-templates.js | 4 +++- src/strings-default.json | 9 ++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/data/things.js b/src/data/things.js index 035879f1..6a5cdb5e 100644 --- a/src/data/things.js +++ b/src/data/things.js @@ -1712,6 +1712,7 @@ Object.assign(Language.prototype, { }, // TODO: These are hard-coded. Is there a better way? + countAdditionalFiles: countHelper('additionalFiles', 'files'), countAlbums: countHelper('albums'), countCommentaryEntries: countHelper('commentaryEntries', 'entries'), countContributions: countHelper('contributions'), diff --git a/src/misc-templates.js b/src/misc-templates.js index c337f6e2..61afa710 100644 --- a/src/misc-templates.js +++ b/src/misc-templates.js @@ -51,7 +51,9 @@ export function generateAdditionalFilesList(additionalFiles, {language, getFileS const fileCount = additionalFiles.flatMap(g => g.files).length; return fixWS` -

${language.$('releaseInfo.additionalFiles.heading', {fileCount})}

+

${language.$('releaseInfo.additionalFiles.heading', { + additionalFiles: language.countAdditionalFiles(fileCount, {unit: true}) + })}

${additionalFiles.map(({ title, description, files }) => fixWS`
${(description diff --git a/src/strings-default.json b/src/strings-default.json index b607b06e..fb2e333c 100644 --- a/src/strings-default.json +++ b/src/strings-default.json @@ -8,6 +8,13 @@ "count.tracks.withUnit.few": "", "count.tracks.withUnit.many": "", "count.tracks.withUnit.other": "{TRACKS} tracks", + "count.additionalFiles": "{FILES}", + "count.additionalFiles.withUnit.zero": "", + "count.additionalFiles.withUnit.one": "{FILES} additional file", + "count.additionalFiles.withUnit.two": "", + "count.additionalFiles.withUnit.few": "", + "count.additionalFiles.withUnit.many": "", + "count.additionalFiles.withUnit.other": "{FILES} additional files", "count.albums": "{ALBUMS}", "count.albums.withUnit.zero": "", "count.albums.withUnit.one": "{ALBUMS} album", @@ -105,7 +112,7 @@ "releaseInfo.artTags": "Tags:", "releaseInfo.additionalFiles.shortcut": "{ANCHOR_LINK} {TITLES}", "releaseInfo.additionalFiles.shortcut.anchorLink": "Additional files:", - "releaseInfo.additionalFiles.heading": "Has {FILE_COUNT} additional files:", + "releaseInfo.additionalFiles.heading": "Has {ADDITIONAL_FILES}:", "releaseInfo.additionalFiles.entry": "{TITLE}", "releaseInfo.additionalFiles.entry.withDescription": "{TITLE}: {DESCRIPTION}", "releaseInfo.additionalFiles.file": "{FILE}", -- cgit 1.3.0-6-gf8a5