From 7462e5126a387c2bd35dbb66f972f68ebaf42a84 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 5 Mar 2021 21:58:39 -0400 Subject: specify unique string per chronology heading word --- strings-default.json | 7 +++---- upd8.js | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/strings-default.json b/strings-default.json index 10430c77..d9ab89a7 100644 --- a/strings-default.json +++ b/strings-default.json @@ -67,10 +67,9 @@ "misc.alt.artistAvatar": "artist avatar", "misc.alt.flashArt": "flash art", "misc.chronology.seeArtistPages": "(See artist pages for chronology info!)", - "misc.chronology.heading": "{INDEX} {WORD} by {ARTIST}", - "misc.chronology.coverArt": "cover art", - "misc.chronology.flash": "flash/game", - "misc.chronology.track": "track", + "misc.chronology.heading.coverArt": "Cover art {INDEX} by {ARTIST}", + "misc.chronology.heading.flash": "Flash/game {INDEX} by {ARTIST}", + "misc.chronology.heading.track": "Track {INDEX} by {ARTIST}", "misc.external.bandcamp": "Bandcamp", "misc.external.bandcamp.domain": "Bandcamp ({DOMAIN})", "misc.external.deviantart": "DeviantArt", diff --git a/upd8.js b/upd8.js index 12549c5c..61a6ee8c 100755 --- a/upd8.js +++ b/upd8.js @@ -3487,7 +3487,7 @@ function generateNavForFlash(flash, {strings, to}) {
${chronologyLinks(flash, { strings, to, - headingWord: strings('misc.chronology.flash'), + headingString: 'misc.chronology.heading.flash', contribKey: 'contributors', getThings: artist => artist.flashes.asContributor })} @@ -4702,7 +4702,7 @@ function iconifyURL(url) { function chronologyLinks(currentThing, { strings, to, - headingWord, + headingString, contribKey, getThings }) { @@ -4734,13 +4734,14 @@ function chronologyLinks(currentThing, { next && `Next` ].filter(Boolean); + const stringOpts = { + index: strings.count.index(index + 1, {strings}), + artist: strings.link.artist(artist, {to}) + }; + return fixWS`
- ${strings('misc.chronology.heading', { - index: strings.count.index(index + 1), - word: headingWord, - artist: strings.link.artist(artist, {to}) - })} + ${strings(headingString, stringOpts)} ${parts.length && `(${parts.join(', ')})`}
`; @@ -4768,13 +4769,13 @@ function generateAlbumChronologyLinks(album, currentTrack, {strings, to}) { return [ currentTrack && chronologyLinks(currentTrack, { strings, to, - headingWord: strings('misc.chronology.track'), + headingString: 'misc.chronology.heading.track', contribKey: 'artists', getThings: artist => [...artist.tracks.asArtist, ...artist.tracks.asContributor] }), chronologyLinks(currentTrack || album, { strings, to, - headingWord: strings('misc.chronology.coverArt'), + headingString: 'misc.chronology.heading.coverArt', contribKey: 'coverArtists', getThings: artist => [...artist.albums.asCoverArtist, ...artist.tracks.asCoverArtist] }) -- cgit 1.3.0-6-gf8a5