Skip to content

A language's name is capitalized inside a sentence #979

Closed

Description

@richshaw

Needs your OK: this changes how account Settings writes a language's name inside a sentence, so Swedish reads "Byt till svenska …". English is unchanged. Swap pipeline:proposed for pipeline:ready to have it built.

What happens

  • languageName in src/i18n/config.ts has only a list form. It takes the name from Intl.DisplayNames and raises the first letter, so a list to choose from reads "English, Svenska". That's right for the radio labels in account Settings and in a signup's Settings tab.
  • Account Settings also puts that name inside a sentence. The switch button and its confirmation (organizer.settings.language.switch and switched, rendered in src/app/app/(chrome)/settings/page.tsx) get languageName(current) as {name}. In Swedish they read "Byt till Svenska för dina 2 öppna anmälningslistor" and "Sparat. Dina 2 öppna anmälningslistor använder nu Svenska." Swedish writes a language's name in lower case in running text: "svenska".
  • English hides it. English capitalizes a language's name in a sentence and in a list alike, so "Switch your 3 open signups to Svenska" looks right, and so do the tests.
  • The catalog can't fix it. The name arrives as an argument, and the Swedish glossary in docs/translating.md says so. Translate the organizer strip, header, settings and share panel into Swedish #976's translation review raised it.
  • Nobody sees it yet, since Swedish isn't in SHIPPED. It shows the day Swedish launches.

Fix, in outline

  • A sentence form beside the list form, for example languageName(locale, { inSentence: sentenceLocale }). The name stays in its own language, as now. Its first letter follows the rule of the language the sentence is in: raised in English, as CLDR writes it in Swedish ("svenska").
  • Use it where the name sits inside a sentence: today that's switch and switched on account Settings. The radio labels keep the list form and their capital.
  • Tests per catalog language: unit tests in src/i18n/config.test.ts pin both forms for every pair of catalog languages, and settings/page.test.tsx checks the button and the confirmation in each.

Watch for

  • Keep the name's lang. The <language> tag wraps it in <span lang={current}>.
  • No code names Swedish. The launch is "ship a language" (Signups can't be in Swedish yet #639): nothing outside the Swedish catalog and glossary names it, so the rule has to hold for the next language with no code change.
  • The Magic Compose prompt calls languageName(fallbackLocale, 'en') inside an English sentence. English capitalizes, so it stays as it is.
  • The glossary note. docs/translating.md says the capital in "Byt till Svenska" is the code's choice. Update it in the same change.
  • Before the launch. This must land before Swedish launches (Signups can't be in Swedish yet #639).

Choices this makes

  • Where the casing rule comes from. Default: from CLDR, with no table. A language that writes its own name in lower case (svenska, suomi, français) writes language names in lower case in a sentence; one that capitalizes its own (English, Deutsch, Nederlands) keeps the capital. That's right for every language checked so far, and a new language needs no code. The alternative is one message per catalog that its translator sets, which costs a key in every language.
  • The name stays in its own language, as now ("Switch … to Svenska", not "to Swedish"), so English is unchanged.

Order

Built on the localization stack; see #619. After #976, because the Swedish switch and switched messages this reads come with it, on top of #956, which moved the button's English into the catalog.

Gate

Owner (UX, small). It changes Swedish text people will read.

Done when

  • In Swedish, the switch button reads "Byt till svenska för …" and its confirmation "… använder nu svenska."
  • English is unchanged, byte for byte: "Switch your 3 open signups to Svenska", "Saved. Your 3 open signups now use English."
  • The radio labels keep their capital in every language ("English", "Svenska").
  • Tests for each catalog language pin both forms, and the button and confirmation.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass.

Raised by the translation review on #976, and checked against its head (af04051).

Found during the phase 2 localization work (#619).

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

Activity

  1. added
    bug
    pipeline:ux
    on Nov 15, 2026
  2. removed
    pipeline:ux
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions