From 2fa9baf09753243cc223859c06abad8abfc9bf2a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 10 May 2022 20:34:15 -0300 Subject: rename list utilities --- src/page/album.js | 4 ++-- src/page/artist.js | 12 ++++++------ src/page/flash.js | 2 +- src/page/group.js | 2 +- src/page/track.js | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index 448ef72e..d24ebafd 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -190,7 +190,7 @@ export function write(album, {wikiData}) { }

`} ${album.urls?.length && `

${ language.$('releaseInfo.listenOn', { - links: strings.list.or(album.urls.map(url => fancifyURL(url, {album: true}))) + links: language.formatDisjunctionList(album.urls.map(url => fancifyURL(url, {album: true}))) }) }

`} ${album.trackGroups && (album.trackGroups.length > 1 || !album.trackGroups[0].isDefaultTrackGroup) ? fixWS` @@ -342,7 +342,7 @@ export function generateAlbumSidebar(album, currentTrack, { ${!currentTrack && transformMultiline(group.descriptionShort)} ${group.urls?.length && `

${ language.$('releaseInfo.visitOn', { - links: strings.list.or(group.urls.map(url => fancifyURL(url))) + links: language.formatDisjunctionList(group.urls.map(url => fancifyURL(url))) }) }

`} ${!currentTrack && fixWS` diff --git a/src/page/artist.js b/src/page/artist.js index 7d28feec..68eaf53b 100644 --- a/src/page/artist.js +++ b/src/page/artist.js @@ -149,7 +149,7 @@ export function write(artist, {wikiData}) { ? language.$('artistPage.creditList.entry.withArtists.withContribution', { entry, artists: getArtistString(artists), - contribution: (contrib.whatArray ? strings.list.unit(contrib.whatArray) : contrib.what) + contribution: (contrib.whatArray ? language.formatUnitList(contrib.whatArray) : contrib.what) }) : language.$('artistPage.creditList.entry.withArtists', { entry, @@ -158,7 +158,7 @@ export function write(artist, {wikiData}) { : ((contrib.what || contrib.whatArray?.length) ? language.$('artistPage.creditList.entry.withContribution', { entry, - contribution: (contrib.whatArray ? strings.list.unit(contrib.whatArray) : contrib.what) + contribution: (contrib.whatArray ? language.formatUnitList(contrib.whatArray) : contrib.what) }) : entry))); @@ -300,7 +300,7 @@ export function write(artist, {wikiData}) {
`} ${urls?.length && `

${language.$('releaseInfo.visitOn', { - links: strings.list.or(urls.map(url => fancifyURL(url, {strings}))) + links: language.formatDisjunctionList(urls.map(url => fancifyURL(url, {strings}))) })}

`} ${hasGallery && `

${language.$('artistPage.viewArtGallery', { link: link.artistGallery(artist, { @@ -308,7 +308,7 @@ export function write(artist, {wikiData}) { }) })}

`}

${language.$('misc.jumpTo.withLinks', { - links: strings.list.unit([ + links: language.formatUnitList([ allTracks.length && `${language.$('artistPage.trackList.title')}`, artThingsAll.length && `${language.$('artistPage.artList.title')}`, wikiInfo.enableFlashesAndGames && flashes.length && `${language.$('artistPage.flashList.title')}`, @@ -322,7 +322,7 @@ export function write(artist, {wikiData}) { duration: language.formatDuration(totalDuration, {approximate: true, unit: true}) })}

${language.$('artistPage.musicGroupsLine', { - groups: strings.list.unit(musicGroups + groups: language.formatUnitList(musicGroups .map(({ group, contributions }) => language.$('artistPage.groupsLine.item', { group: link.groupInfo(group), contributions: language.countContributions(contributions) @@ -338,7 +338,7 @@ export function write(artist, {wikiData}) { }) })}

`}

${language.$('artistPage.artGroupsLine', { - groups: strings.list.unit(artGroups + groups: language.formatUnitList(artGroups .map(({ group, contributions }) => language.$('artistPage.groupsLine.item', { group: link.groupInfo(group), contributions: language.countContributions(contributions) diff --git a/src/page/flash.js b/src/page/flash.js index fe72a8bd..97824e07 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -50,7 +50,7 @@ export function write(flash, {wikiData}) { })}

${language.$('releaseInfo.released', {date: language.formatDate(flash.date)})}

${(flash.page || flash.urls?.length) && `

${language.$('releaseInfo.playOn', { - links: strings.list.or([ + links: language.formatDisjunctionList([ flash.page && getFlashLink(flash), ...flash.urls ?? [] ].map(url => fancifyFlashURL(url, flash))) diff --git a/src/page/group.js b/src/page/group.js index 0467cada..1aea3fb1 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -50,7 +50,7 @@ export function write(group, {wikiData}) {

${language.$('groupInfoPage.title', {group: group.name})}

${group.urls?.length && `

${ language.$('releaseInfo.visitOn', { - links: strings.list.or(group.urls.map(url => fancifyURL(url, {strings}))) + links: language.formatDisjunctionList(group.urls.map(url => fancifyURL(url, {strings}))) }) }

`}
diff --git a/src/page/track.js b/src/page/track.js index 295f4257..7cc6d5ab 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -196,7 +196,7 @@ export function write(track, {wikiData}) {

${ (track.urls?.length ? language.$('releaseInfo.listenOn', { - links: strings.list.or(track.urls.map(url => fancifyURL(url, {strings}))) + links: language.formatDisjunctionList(track.urls.map(url => fancifyURL(url, {strings}))) }) : language.$('releaseInfo.listenOn.noLinks')) }

-- cgit 1.3.0-6-gf8a5