refactor: every count in the web app is said by one plural(), with the viewer's thousands separator; a source guard names any hand-written copy (M505 #5642)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 16:18:04 -04:00
co-authored by Claude Opus 5.5
parent af2d4f9859
commit 9e24b2b4fc
34 changed files with 144 additions and 75 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { plural } from '#lib/utils/plural.js';
import { pageTitle } from '#lib/branding.js';
import { createAlbumsAlphaInfiniteQuery } from '#lib/api/albums.js';
import AlbumCard from '#lib/components/AlbumCard.svelte';
@@ -35,7 +36,7 @@
<h1 class="font-display text-2xl font-medium text-text-primary">Albums</h1>
{#if !query.isPending && !(query.isError && !query.isFetchNextPageError)}
<p class="text-sm text-text-secondary">
{total} {total === 1 ? 'album' : 'albums'}
{plural(total, 'album', 'albums')}
</p>
{/if}
</div>
+2 -1
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { plural } from '#lib/utils/plural.js';
import { pageTitle } from '#lib/branding.js';
import { createArtistsQuery } from '#lib/api/queries.js';
import ArtistCard from '#lib/components/ArtistCard.svelte';
@@ -33,7 +34,7 @@
<h1 class="font-display text-2xl font-medium text-text-primary">Artists</h1>
{#if !query.isPending && !(query.isError && !query.isFetchNextPageError)}
<p class="text-sm text-text-secondary">
{total} {total === 1 ? 'artist' : 'artists'}
{plural(total, 'artist', 'artists')}
</p>
{/if}
</div>
+3 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { plural } from '#lib/utils/plural.js';
import { page } from '$app/state';
import { pageTitle } from '#lib/branding.js';
import { ChevronLeft } from 'lucide-svelte';
@@ -131,7 +132,7 @@
<h1 class="font-display text-2xl font-medium text-text-primary">{selected}</h1>
{#if !loading || albums.length > 0}
<p class="text-sm text-text-secondary">
{total} {total === 1 ? 'album' : 'albums'}
{plural(total, 'album', 'albums')}
</p>
{/if}
</div>
@@ -183,7 +184,7 @@
{#if filter.trim()}
{visibleGenres.length} of {genres.length} genres
{:else}
{genres.length} {genres.length === 1 ? 'genre' : 'genres'}, straight from your file tags
{plural(genres.length, 'genre', 'genres')}, straight from your file tags
{/if}
</p>
{/if}
+3 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { plural } from '#lib/utils/plural.js';
import { page } from '$app/state';
import { pageTitle } from '#lib/branding.js';
import { ChevronLeft } from 'lucide-svelte';
@@ -116,7 +117,7 @@
<h1 class="font-display text-2xl font-medium text-text-primary">{selected}</h1>
{#if !loading || albums.length > 0}
<p class="text-sm text-text-secondary">
{total} {total === 1 ? 'album' : 'albums'}
{plural(total, 'album', 'albums')}
</p>
{/if}
</div>
@@ -161,7 +162,7 @@
<h1 class="font-display text-2xl font-medium text-text-primary">Years</h1>
{#if !index.isPending && !index.isError}
<p class="text-sm text-text-secondary">
{years.length} {years.length === 1 ? 'year' : 'years'} with dated releases
{plural(years.length, 'year', 'years')} with dated releases
</p>
{/if}
</header>