From 7056fa7c07ae08f5596c9ef8d8582642890bd764 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 10 May 2022 20:39:43 -0300 Subject: rename strings arg to language --- src/page/album-commentary.js | 4 ++-- src/page/album.js | 14 +++++++------- src/page/artist.js | 26 +++++++++++++------------- src/page/flash.js | 12 ++++++------ src/page/group.js | 18 +++++++++--------- src/page/homepage.js | 2 +- src/page/listing.js | 20 ++++++++++---------- src/page/news.js | 10 +++++----- src/page/static.js | 2 +- src/page/tag.js | 6 +++--- src/page/track.js | 16 ++++++++-------- 11 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src/page') diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js index 5b82ca23..e587b16e 100644 --- a/src/page/album-commentary.js +++ b/src/page/album-commentary.js @@ -32,7 +32,7 @@ export function write(album, {wikiData}) { getLinkThemeString, getThemeString, link, - strings, + language, to, transformMultiline }) => ({ @@ -107,7 +107,7 @@ export function writeTargetless({wikiData}) { path: ['commentaryIndex'], page: ({ link, - strings + language }) => ({ title: language.$('commentaryIndex.title'), diff --git a/src/page/album.js b/src/page/album.js index d24ebafd..45e5439a 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -30,7 +30,7 @@ export function write(album, {wikiData}) { getArtistString, getLinkThemeString, link, - strings + language }) => { const itemOpts = { duration: language.formatDuration(track.duration), @@ -108,14 +108,14 @@ export function write(album, {wikiData}) { getLinkThemeString, getThemeString, link, - strings, + language, transformMultiline }) => { const trackToListItem = bindOpts(unbound_trackToListItem, { getArtistString, getLinkThemeString, link, - strings + language }); const cover = getAlbumCover(album); @@ -234,7 +234,7 @@ export function write(album, {wikiData}) { fancifyURL, getLinkThemeString, link, - strings, + language, transformMultiline, wikiData }), @@ -250,7 +250,7 @@ export function write(album, {wikiData}) { album.tracks.length > 1 && { divider: false, - html: generateAlbumNavLinks(album, null, {strings}) + html: generateAlbumNavLinks(album, null, {language}) } ], content: html.tag('div', generateAlbumChronologyLinks(album, null, {generateChronologyLinks})) @@ -268,7 +268,7 @@ export function generateAlbumSidebar(album, currentTrack, { fancifyURL, getLinkThemeString, link, - strings, + language, transformMultiline, wikiData }) { @@ -385,7 +385,7 @@ export function generateAlbumSidebar(album, currentTrack, { export function generateAlbumNavLinks(album, currentTrack, { generatePreviousNextLinks, - strings + language }) { if (album.tracks.length <= 1) { return ''; diff --git a/src/page/artist.js b/src/page/artist.js index 68eaf53b..0bfcf1c4 100644 --- a/src/page/artist.js +++ b/src/page/artist.js @@ -139,7 +139,7 @@ export function write(artist, {wikiData}) { } const generateEntryAccents = ({ - getArtistString, strings, + getArtistString, language, aka, entry, artists, contrib }) => (aka @@ -163,7 +163,7 @@ export function write(artist, {wikiData}) { : entry))); const unbound_generateTrackList = (chunks, { - getArtistString, link, strings + getArtistString, link, language }) => fixWS`
${chunks.map(({date, album, chunk, duration}) => fixWS` @@ -193,7 +193,7 @@ export function write(artist, {wikiData}) { })) .map(({aka, ...opts}) => html.tag('li', {class: aka && 'rerelease'}, - generateEntryAccents({getArtistString, strings, aka, ...opts}))) + generateEntryAccents({getArtistString, language, aka, ...opts}))) .join('\n'))} `).join('\n')} @@ -272,14 +272,14 @@ export function write(artist, {wikiData}) { getArtistAvatar, getArtistString, link, - strings, + language, to, transformMultiline }) => { const generateTrackList = bindOpts(unbound_generateTrackList, { getArtistString, link, - strings + language }); return { @@ -300,7 +300,7 @@ export function write(artist, {wikiData}) {
`} ${urls?.length && `

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

`} ${hasGallery && `

${language.$('artistPage.viewArtGallery', { link: link.artistGallery(artist, { @@ -364,7 +364,7 @@ export function write(artist, {wikiData}) { }[key])}`), ...props })) - .map(opts => generateEntryAccents({getArtistString, strings, ...opts})) + .map(opts => generateEntryAccents({getArtistString, language, ...opts})) .map(row => `

  • ${row}
  • `) .join('\n'))} @@ -387,7 +387,7 @@ export function write(artist, {wikiData}) { }), ...props })) - .map(opts => generateEntryAccents({getArtistString, strings, ...opts})) + .map(opts => generateEntryAccents({getArtistString, language, ...opts})) .map(row => `
  • ${row}
  • `) .join('\n'))} @@ -420,7 +420,7 @@ export function write(artist, {wikiData}) { nav: generateNavForArtist(artist, false, hasGallery, { generateInfoGalleryLinks, link, - strings, + language, wikiData }) }; @@ -436,7 +436,7 @@ export function write(artist, {wikiData}) { getGridHTML, getTrackCover, link, - strings, + language, to }) => ({ title: language.$('artistGalleryPage.title', {artist: name}), @@ -465,7 +465,7 @@ export function write(artist, {wikiData}) { nav: generateNavForArtist(artist, true, hasGallery, { generateInfoGalleryLinks, link, - strings, + language, wikiData }) }) @@ -479,14 +479,14 @@ export function write(artist, {wikiData}) { function generateNavForArtist(artist, isGallery, hasGallery, { generateInfoGalleryLinks, link, - strings, + language, wikiData }) { const { wikiInfo } = wikiData; const infoGalleryLinks = (hasGallery && generateInfoGalleryLinks(artist, isGallery, { - link, strings, + link, language, linkKeyGallery: 'artistGallery', linkKeyInfo: 'artist' })) diff --git a/src/page/flash.js b/src/page/flash.js index 97824e07..58969b15 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -33,7 +33,7 @@ export function write(flash, {wikiData}) { getFlashCover, getThemeString, link, - strings, + language, transformInline }) => ({ title: language.$('flashPage.title', {flash: flash.name}), @@ -85,12 +85,12 @@ export function write(flash, {wikiData}) { ` }, - sidebarLeft: generateSidebarForFlash(flash, {link, strings, wikiData}), + sidebarLeft: generateSidebarForFlash(flash, {link, language, wikiData}), nav: generateNavForFlash(flash, { generateChronologyLinks, generatePreviousNextLinks, link, - strings, + language, wikiData }) }) @@ -109,7 +109,7 @@ export function writeTargetless({wikiData}) { getFlashGridHTML, getLinkThemeString, link, - strings + language }) => ({ title: language.$('flashIndex.title'), @@ -150,7 +150,7 @@ function generateNavForFlash(flash, { generateChronologyLinks, generatePreviousNextLinks, link, - strings, + language, wikiData }) { const { flashData, wikiInfo } = wikiData; @@ -191,7 +191,7 @@ function generateNavForFlash(flash, { }; } -function generateSidebarForFlash(flash, {link, strings, wikiData}) { +function generateSidebarForFlash(flash, {link, language, wikiData}) { // all hard-coded, sorry :( // this doesnt have a super portable implementation/design...yet!! diff --git a/src/page/group.js b/src/page/group.js index 1aea3fb1..eb401dd0 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -39,7 +39,7 @@ export function write(group, {wikiData}) { getThemeString, fancifyURL, link, - strings, + language, transformMultiline }) => ({ title: language.$('groupInfoPage.title', {group: group.name}), @@ -50,7 +50,7 @@ export function write(group, {wikiData}) {

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

    ${group.urls?.length && `

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

    `}
    @@ -92,7 +92,7 @@ export function write(group, {wikiData}) { sidebarLeft: generateGroupSidebar(group, false, { getLinkThemeString, link, - strings, + language, wikiData }), @@ -100,7 +100,7 @@ export function write(group, {wikiData}) { generateInfoGalleryLinks, generatePreviousNextLinks, link, - strings, + language, wikiData }) }) @@ -116,7 +116,7 @@ export function write(group, {wikiData}) { getLinkThemeString, getThemeString, link, - strings + language }) => ({ title: language.$('groupGalleryPage.title', {group: group.name}), theme: getThemeString(group.color), @@ -152,7 +152,7 @@ export function write(group, {wikiData}) { sidebarLeft: generateGroupSidebar(group, true, { getLinkThemeString, link, - strings, + language, wikiData }), @@ -160,7 +160,7 @@ export function write(group, {wikiData}) { generateInfoGalleryLinks, generatePreviousNextLinks, link, - strings, + language, wikiData }) }) @@ -174,7 +174,7 @@ export function write(group, {wikiData}) { function generateGroupSidebar(currentGroup, isGallery, { getLinkThemeString, link, - strings, + language, wikiData }) { const { groupCategoryData, wikiInfo } = wikiData; @@ -217,7 +217,7 @@ function generateGroupNav(currentGroup, isGallery, { generateInfoGalleryLinks, generatePreviousNextLinks, link, - strings, + language, wikiData }) { const { groupData, wikiInfo } = wikiData; diff --git a/src/page/homepage.js b/src/page/homepage.js index 01844fb4..b20fc812 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -23,7 +23,7 @@ export function writeTargetless({wikiData}) { getAlbumGridHTML, getLinkThemeString, link, - strings, + language, to, transformInline, transformMultiline diff --git a/src/page/listing.js b/src/page/listing.js index a6f9e9e1..261b1e90 100644 --- a/src/page/listing.js +++ b/src/page/listing.js @@ -43,7 +43,7 @@ export function write(listing, {wikiData}) { type: 'page', path: ['listing', listing.directory], page: opts => { - const { getLinkThemeString, link, strings } = opts; + const { getLinkThemeString, link, language } = opts; const titleKey = `listingPage.${listing.stringsKey}.title`; return { @@ -70,7 +70,7 @@ export function write(listing, {wikiData}) { content: generateSidebarForListings(listing, { getLinkThemeString, link, - strings, + language, wikiData }) }, @@ -102,7 +102,7 @@ export function writeTargetless({wikiData}) { path: ['listingIndex'], page: ({ getLinkThemeString, - strings, + language, link }) => ({ title: language.$('listingIndex.title'), @@ -118,7 +118,7 @@ export function writeTargetless({wikiData}) { })}


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

    - ${generateLinkIndexForListings(null, false, {link, strings, wikiData})} + ${generateLinkIndexForListings(null, false, {link, language, wikiData})} ` }, @@ -126,7 +126,7 @@ export function writeTargetless({wikiData}) { content: generateSidebarForListings(null, { getLinkThemeString, link, - strings, + language, wikiData }) }, @@ -143,7 +143,7 @@ export function writeTargetless({wikiData}) { function generateSidebarForListings(currentListing, { getLinkThemeString, link, - strings, + language, wikiData }) { return fixWS` @@ -151,7 +151,7 @@ function generateSidebarForListings(currentListing, { ${generateLinkIndexForListings(currentListing, true, { getLinkThemeString, link, - strings, + language, wikiData })} `; @@ -160,7 +160,7 @@ function generateSidebarForListings(currentListing, { function generateLinkIndexForListings(currentListing, forSidebar, { getLinkThemeString, link, - strings, + language, wikiData }) { const { listingTargetSpec, wikiInfo } = wikiData; @@ -188,13 +188,13 @@ function generateLinkIndexForListings(currentListing, forSidebar, { {style: getLinkThemeString(wikiInfo.color)}, html.tag('span', {class: 'group-name'}, - title({strings}))), + title({language}))), genUL(listings) ])).join('\n'); } else { return html.tag('dl', filteredByCondition.flatMap(({ title, listings }) => [ - html.tag('dt', title({strings})), + html.tag('dt', title({language})), html.tag('dd', genUL(listings)) ])); } diff --git a/src/page/news.js b/src/page/news.js index 47239583..4f5c5059 100644 --- a/src/page/news.js +++ b/src/page/news.js @@ -21,7 +21,7 @@ export function write(entry, {wikiData}) { page: ({ generatePreviousNextLinks, link, - strings, + language, transformMultiline, }) => ({ title: language.$('newsEntryPage.title', {entry: entry.name}), @@ -39,7 +39,7 @@ export function write(entry, {wikiData}) { nav: generateNewsEntryNav(entry, { generatePreviousNextLinks, link, - strings, + language, wikiData }) }) @@ -56,7 +56,7 @@ export function writeTargetless({wikiData}) { path: ['newsIndex'], page: ({ link, - strings, + language, transformMultiline }) => ({ title: language.$('newsIndex.title'), @@ -90,7 +90,7 @@ export function writeTargetless({wikiData}) { function generateNewsEntryNav(entry, { generatePreviousNextLinks, link, - strings, + language, wikiData }) { const { wikiInfo, newsData } = wikiData; @@ -98,7 +98,7 @@ function generateNewsEntryNav(entry, { // The newsData list is sorted reverse chronologically (newest ones first), // so the way we find next/previous entries is flipped from normal. const previousNextLinks = generatePreviousNextLinks(entry, { - link, strings, + link, language, data: newsData.slice().reverse(), linkKey: 'newsEntry' }); diff --git a/src/page/static.js b/src/page/static.js index ff57c4fb..e9b6a047 100644 --- a/src/page/static.js +++ b/src/page/static.js @@ -17,7 +17,7 @@ export function write(staticPage, {wikiData}) { type: 'page', path: ['staticPage', staticPage.directory], page: ({ - strings, + language, transformMultiline }) => ({ title: staticPage.name, diff --git a/src/page/tag.js b/src/page/tag.js index af2e3942..8e5e6999 100644 --- a/src/page/tag.js +++ b/src/page/tag.js @@ -34,7 +34,7 @@ export function write(tag, {wikiData}) { getThemeString, getTrackCover, link, - strings, + language, to }) => ({ title: language.$('tagPage.title', {tag: tag.name}), @@ -64,7 +64,7 @@ export function write(tag, {wikiData}) { nav: generateTagNav(tag, { generatePreviousNextLinks, link, - strings, + language, wikiData }) }) @@ -78,7 +78,7 @@ export function write(tag, {wikiData}) { function generateTagNav(tag, { generatePreviousNextLinks, link, - strings, + language, wikiData }) { const previousNextLinks = generatePreviousNextLinks(tag, { diff --git a/src/page/track.js b/src/page/track.js index 7cc6d5ab..5249ea44 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -50,7 +50,7 @@ export function write(track, {wikiData}) { .flatMap(track => track.featuredInFlashes.map(flash => ({flash, as: track})))); } - const unbound_generateTrackList = (tracks, {getArtistString, link, strings}) => html.tag('ul', + const unbound_generateTrackList = (tracks, {getArtistString, link, language}) => html.tag('ul', tracks.map(track => { const line = language.$('trackList.item.withArtists', { track: link.track(track), @@ -67,7 +67,7 @@ export function write(track, {wikiData}) { const hasCommentary = track.commentary || otherReleases.some(t => t.commentary); const generateCommentary = ({ link, - strings, + language, transformMultiline }) => transformMultiline([ track.commentary, @@ -130,13 +130,13 @@ export function write(track, {wikiData}) { getThemeString, getTrackCover, link, - strings, + language, transformInline, transformLyrics, transformMultiline, to }) => { - const generateTrackList = bindOpts(unbound_generateTrackList, {getArtistString, link, strings}); + const generateTrackList = bindOpts(unbound_generateTrackList, {getArtistString, link, language}); const cover = getTrackCover(track); return { @@ -196,7 +196,7 @@ export function write(track, {wikiData}) {

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

    @@ -266,7 +266,7 @@ export function write(track, {wikiData}) { ${hasCommentary && fixWS`

    ${language.$('releaseInfo.artistCommentary')}

    - ${generateCommentary({link, strings, transformMultiline})} + ${generateCommentary({link, language, transformMultiline})}
    `} ` @@ -276,7 +276,7 @@ export function write(track, {wikiData}) { fancifyURL, getLinkThemeString, link, - strings, + language, transformMultiline, wikiData }), @@ -303,7 +303,7 @@ export function write(track, {wikiData}) { divider: false, html: generateAlbumNavLinks(album, track, { generatePreviousNextLinks, - strings + language }) } ].filter(Boolean), -- cgit 1.3.0-6-gf8a5