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
+7
View File
@@ -0,0 +1,7 @@
// A count with its noun: "1 track", "26,171 tracks". The noun may carry the
// words that agree with it ("album has" / "albums have"). The number is in the
// viewer's locale, as the app's other counts are. The web app's one way to say
// a count (M505); a source guard in plural.test.ts names any hand-written copy.
export function plural(n: number, one: string, many: string): string {
return `${n.toLocaleString()} ${n === 1 ? one : many}`;
}