Skip to content

fix(web): persist docs English locale selection#29351

Open
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/docs-language-selector-default-locale
Open

fix(web): persist docs English locale selection#29351
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/docs-language-selector-default-locale

Conversation

@YOMXXX
Copy link
Copy Markdown

@YOMXXX YOMXXX commented May 26, 2026

Issue for this PR

Closes #29326

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes the docs language picker path where selecting English from a localized docs page navigates to the unprefixed default-locale URL but did not update oc_locale. The middleware now treats unprefixed docs HTML navigations as an English selection and persists oc_locale=en, while keeping localized paths and non-HTML asset requests unchanged.

How did you verify your code works?

  • cd packages/web && PATH="$HOME/.bun/bin:$PATH" bun test src/middleware-locale.test.ts
  • git diff --check
  • PATH="$HOME/.bun/bin:$PATH" .husky/pre-push
  • cd packages/web && PATH="$HOME/.bun/bin:$PATH" bun run astro check (attempted; exits with existing unrelated diagnostics in src/components/Share.tsx, src/components/share/part.tsx, and src/pages/s/[id].astro)

Screenshots / recordings

N/A (middleware-only change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.

Language picker in docs does nothing

1 participant