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:
@@ -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}`;
|
||||
}
|
||||
Reference in New Issue
Block a user