Skip to content

Add i18n support for dark/light mode menu - #2482

Merged
chalin merged 4 commits into
docsy:mainfrom
tcrouch:ui_theme_i18n
Aug 27, 2026
Merged

chalin merged 4 commits into
docsy:mainfrom
tcrouch:ui_theme_i18n

Conversation

@tcrouch

@tcrouch tcrouch commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor
  • Fixes i18n support for dark mode menu button #1987
  • Replaces the hardcoded Light/Dark/Auto labels in the theme-toggler menu with ui_theme_* i18n lookups, so that sites can localize or override them without forking the partial
  • Adds the three keys to all 31 locale catalogs, with best-effort translations using OS-canonical terms; native-speaker corrections welcome as follow-up PRs
  • Known limitation: the toggler's aria-labels and hidden toggle text remain hardcoded English; screen-reader localization is a follow-up
  • Preview: deploy-preview-2482 and its fr locale rendering Clair/Sombre/Automatique; the menu sits in the top navbar

@tcrouch
tcrouch force-pushed the ui_theme_i18n branch 2 times, most recently from 7ca93dd to 6371083 Compare July 27, 2026 15:06
@chalin chalin added this to the 26Q3 milestone Aug 27, 2026
@chalin chalin added the i18n Internationalization / Localization label Aug 27, 2026

@chalin chalin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tcrouch.

Validated the labels against Starlight's themeSelect.* and Hextra's locale catalogs: 19 of 22 overlapping locales match Starlight exactly or near-exactly (Docsy spells out "automatic" where Starlight clips to "Auto"). Word-choice divergences, none of them errors:

  • fa: تاریک here vs Starlight's تیره; synonyms for "dark".
  • hi: adjectives (हल्का/गहरा) here vs Starlight's literal nouns; the adjectives arguably fit a mode label better.
  • ko: transliterations (라이트/다크, iOS-style) here vs Starlight/Hextra's spelled-out 밝은/어두운 테마 (Android-style); both attested.
  • ro: Luminoasă here vs Starlight's Deschisă; both feminine, both in use.

Feedback on any of the wording is still welcome: comment here or send a follow-up PR.

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

Labels

i18n Internationalization / Localization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n support for dark mode menu button

2 participants