Skip to content

[diffs] fix pluralization of '0 unmodified lines'#694

Open
necolas wants to merge 1 commit into
mainfrom
nicolas/diffs-plural-fix
Open

[diffs] fix pluralization of '0 unmodified lines'#694
necolas wants to merge 1 commit into
mainfrom
nicolas/diffs-plural-fix

Conversation

@necolas

@necolas necolas commented May 18, 2026

Copy link
Copy Markdown
Contributor

Does what it says on the tin

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffshub Error Error May 18, 2026 7:26pm
pierre-docs-trees Ready Ready Preview May 18, 2026 7:26pm
pierrejs-diff-demo Ready Ready Preview May 18, 2026 7:26pm
pierrejs-docs Ready Ready Preview May 18, 2026 7:26pm

Request Review

@necolas necolas requested a review from amadeus May 18, 2026 19:26
@amadeus

amadeus commented May 18, 2026

Copy link
Copy Markdown
Member

Might be worth applying this on the beta instead of stable, since i don't think we'll do a stable release before 1.2 at this point

@SlexAxton

Copy link
Copy Markdown
Contributor

Might not be worth it, but the More Official™ to do this would be:

const enCardinalRules = new Intl.PluralRules("en-US"); // can cache this once

const pluralKey = enCardinalRules.select(lines);

if (pluralKey === 'one') {
  return `${lines} unmodified line`;
} else if (pluralKey === 'other') {
  return `${lines} unmodified lines`;
} else {
  throw new Error(`Unexpected plural key: ${pluralKey}`);
}

@amadeus

amadeus commented Jun 10, 2026

Copy link
Copy Markdown
Member

@necolas do we still want to get this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants