From 847b1262bf608cadd59c8d19a564badbd525a6a7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 10 May 2022 20:24:46 -0300 Subject: rename other count utils --- src/page/album-commentary.js | 6 +++--- src/page/album.js | 12 ++++++------ src/page/artist.js | 16 ++++++++-------- src/page/flash.js | 2 +- src/page/group.js | 2 +- src/page/homepage.js | 2 +- src/page/listing.js | 2 +- src/page/news.js | 6 +++--- src/page/track.js | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src/page') diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js index 3c2b23cc..5b82ca23 100644 --- a/src/page/album-commentary.js +++ b/src/page/album-commentary.js @@ -47,7 +47,7 @@ export function write(album, {wikiData}) { album: link.album(album) })}

${language.$('albumCommentaryPage.infoLine', { - words: `${strings.count.words(words, {unit: true})}`, + words: `${language.formatWordCount(words, {unit: true})}`, entries: `${language.countCommentaryEntries(entries.length, {unit: true})}` })}

${album.commentary && fixWS` @@ -116,7 +116,7 @@ export function writeTargetless({wikiData}) {

${language.$('commentaryIndex.title')}

${language.$('commentaryIndex.infoLine', { - words: `${strings.count.words(totalWords, {unit: true})}`, + words: `${language.formatWordCount(totalWords, {unit: true})}`, entries: `${language.countCommentaryEntries(totalEntries, {unit: true})}` })}

${language.$('commentaryIndex.albumList.title')}

@@ -125,7 +125,7 @@ export function writeTargetless({wikiData}) { .map(({ album, entries, words }) => fixWS`
  • ${language.$('commentaryIndex.albumList.item', { album: link.albumCommentary(album), - words: strings.count.words(words, {unit: true}), + words: language.formatWordCount(words, {unit: true}), entries: language.countCommentaryEntries(entries.length, {unit: true}) })}
  • `) diff --git a/src/page/album.js b/src/page/album.js index 4b4ac6bd..448ef72e 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -33,7 +33,7 @@ export function write(album, {wikiData}) { strings }) => { const itemOpts = { - duration: strings.count.duration(track.duration), + duration: language.formatDuration(track.duration), track: link.track(track) }; return `
  • ${ @@ -169,15 +169,15 @@ export function write(album, {wikiData}) { }) }), album.date && language.$('releaseInfo.released', { - date: strings.count.date(album.date) + date: language.formatDate(album.date) }), (album.coverArtDate && +album.coverArtDate !== +album.date && language.$('releaseInfo.artReleased', { - date: strings.count.date(album.coverArtDate) + date: language.formatDate(album.coverArtDate) })), language.$('releaseInfo.duration', { - duration: strings.count.duration(albumDuration, {approximate: album.tracks.length > 1}) + duration: language.formatDuration(albumDuration, {approximate: album.tracks.length > 1}) }) ].filter(Boolean).join('
    \n')}

    @@ -198,7 +198,7 @@ export function write(album, {wikiData}) { ${album.trackGroups.map(({ name, color, startIndex, tracks }) => fixWS`
    ${ language.$('trackList.group', { - duration: strings.count.duration(getTotalDuration(tracks), {approximate: tracks.length > 1}), + duration: language.formatDuration(getTotalDuration(tracks), {approximate: tracks.length > 1}), group: name }) }
    @@ -216,7 +216,7 @@ export function write(album, {wikiData}) {

    ${[ language.$('releaseInfo.addedToWiki', { - date: strings.count.date(album.dateAddedToWiki) + date: language.formatDate(album.dateAddedToWiki) }) ].filter(Boolean).join('
    \n')}

    diff --git a/src/page/artist.js b/src/page/artist.js index 3a9de70b..7d28feec 100644 --- a/src/page/artist.js +++ b/src/page/artist.js @@ -170,14 +170,14 @@ export function write(artist, {wikiData}) {
    ${ (date && duration) ? language.$('artistPage.creditList.album.withDate.withDuration', { album: link.album(album), - date: strings.count.date(date), - duration: strings.count.duration(duration, {approximate: true}) + date: language.formatDate(date), + duration: language.formatDuration(duration, {approximate: true}) }) : date ? language.$('artistPage.creditList.album.withDate', { album: link.album(album), - date: strings.count.date(date) + date: language.formatDate(date) }) : duration ? language.$('artistPage.creditList.album.withDuration', { album: link.album(album), - duration: strings.count.duration(duration, {approximate: true}) + duration: language.formatDuration(duration, {approximate: true}) }) : language.$('artistPage.creditList.album', { album: link.album(album) })}
    @@ -187,7 +187,7 @@ export function write(artist, {wikiData}) { aka: track.aka, entry: language.$('artistPage.creditList.entry.track.withDuration', { track: link.track(track), - duration: strings.count.duration(track.duration) + duration: language.formatDuration(track.duration) }), ...props })) @@ -319,7 +319,7 @@ export function write(artist, {wikiData}) {

    ${language.$('artistPage.trackList.title')}

    ${language.$('artistPage.contributedDurationLine', { artist: artist.name, - duration: strings.count.duration(totalDuration, {approximate: true, unit: true}) + duration: language.formatDuration(totalDuration, {approximate: true, unit: true}) })}

    ${language.$('artistPage.musicGroupsLine', { groups: strings.list.unit(musicGroups @@ -348,7 +348,7 @@ export function write(artist, {wikiData}) { ${artListChunks.map(({date, album, chunk}) => fixWS`

    ${language.$('artistPage.creditList.album.withDate', { album: link.album(album), - date: strings.count.date(date) + date: language.formatDate(date) })}
      ${(chunk @@ -377,7 +377,7 @@ export function write(artist, {wikiData}) { ${flashListChunks.map(({act, chunk, dateFirst, dateLast}) => fixWS`
      ${language.$('artistPage.creditList.flashAct.withDateRange', { act: link.flash(chunk[0].flash, {text: act.name}), - dateRange: strings.count.dateRange([dateFirst, dateLast]) + dateRange: language.formatDateRange(dateFirst, dateLast) })}
        ${(chunk diff --git a/src/page/flash.js b/src/page/flash.js index 5e027f70..fe72a8bd 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -48,7 +48,7 @@ export function write(flash, {wikiData}) { src: getFlashCover(flash), alt: language.$('misc.alt.flashArt') })} -

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

        +

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

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

        ${language.$('releaseInfo.playOn', { links: strings.list.or([ flash.page && getFlashLink(flash), diff --git a/src/page/group.js b/src/page/group.js index 53c792a4..0467cada 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -129,7 +129,7 @@ export function write(group, {wikiData}) { language.$('groupGalleryPage.infoLine', { tracks: `${language.countTracks(tracks.length, {unit: true})}`, albums: `${language.countAlbums(albums.length, {unit: true})}`, - time: `${strings.count.duration(totalDuration, {unit: true})}` + time: `${language.formatDuration(totalDuration, {unit: true})}` }) }

        ${wikiInfo.enableGroupUI && wikiInfo.enableListings && html.tag('p', diff --git a/src/page/homepage.js b/src/page/homepage.js index ed7d3442..01844fb4 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -88,7 +88,7 @@ export function writeTargetless({wikiData}) { ${newsData.slice(0, 3).map((entry, i) => html.tag('article', {class: ['news-entry', i === 0 && 'first-news-entry']}, fixWS` -

        ${link.newsEntry(entry)}

        +

        ${link.newsEntry(entry)}

        ${transformMultiline(entry.contentShort)} ${entry.contentShort !== entry.content && link.newsEntry(entry, { text: language.$('homepage.news.entry.viewRest') diff --git a/src/page/listing.js b/src/page/listing.js index efa3fdfd..a6f9e9e1 100644 --- a/src/page/listing.js +++ b/src/page/listing.js @@ -114,7 +114,7 @@ export function writeTargetless({wikiData}) { wiki: wikiInfo.name, tracks: `${language.countTracks(trackData.length, {unit: true})}`, albums: `${language.countAlbums(albumData.length, {unit: true})}`, - duration: `${strings.count.duration(totalDuration, {approximate: true, unit: true})}` + duration: `${language.formatDuration(totalDuration, {approximate: true, unit: true})}` })}


        ${language.$('listingIndex.exploreList')}

        diff --git a/src/page/news.js b/src/page/news.js index 9951a2a8..47239583 100644 --- a/src/page/news.js +++ b/src/page/news.js @@ -30,7 +30,7 @@ export function write(entry, {wikiData}) { content: fixWS`

        ${language.$('newsEntryPage.title', {entry: entry.name})}

        -

        ${language.$('newsEntryPage.published', {date: strings.count.date(entry.date)})}

        +

        ${language.$('newsEntryPage.published', {date: language.formatDate(entry.date)})}

        ${transformMultiline(entry.content)}
        ` @@ -67,7 +67,7 @@ export function writeTargetless({wikiData}) {

        ${language.$('newsIndex.title')}

        ${newsData.map(entry => fixWS`
        -

        ${link.newsEntry(entry)}

        +

        ${link.newsEntry(entry)}

        ${transformMultiline(entry.contentShort)} ${entry.contentShort !== entry.content && `

        ${link.newsEntry(entry, { text: language.$('newsIndex.entry.viewRest') @@ -112,7 +112,7 @@ function generateNewsEntryNav(entry, { }, { html: language.$('newsEntryPage.nav.entry', { - date: strings.count.date(entry.date), + date: language.formatDate(entry.date), entry: link.newsEntry(entry, {class: 'current'}) }) }, diff --git a/src/page/track.js b/src/page/track.js index 92a49ff0..295f4257 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -181,15 +181,15 @@ export function write(track, {wikiData}) { }) }), track.date && language.$('releaseInfo.released', { - date: strings.count.date(track.date) + date: language.formatDate(track.date) }), (track.coverArtDate && +track.coverArtDate !== +track.date && language.$('releaseInfo.artReleased', { - date: strings.count.date(track.coverArtDate) + date: language.formatDate(track.coverArtDate) })), track.duration && language.$('releaseInfo.duration', { - duration: strings.count.duration(track.duration) + duration: language.formatDuration(track.duration) }) ].filter(Boolean).join('
        \n')}

        -- cgit 1.3.0-6-gf8a5