[PR #13756] fix(web): persist English on unprefixed docs routes #14803

Open
opened 2026-02-16 18:19:33 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13756

State: open
Merged: No


What does this PR do?

Closes #13606.
Closes #13744.
Duplicate report: #13754 (closed).

Requests to unprefixed docs paths like /docs/rules/ can still render localized content if a non-root locale cookie is present. This made selecting English in the footer bounce back to Korean content on the same URL. This PR adds middleware handling for unprefixed docs content routes and resets locale to root (oc_locale=en) when a non-root locale is detected, so /docs/... routes consistently render English while keeping locale-prefixed routes (/docs/ko/...) unchanged.

How did you verify your code works?

  • Reproduced current production behavior with oc_locale=ko: /docs/rules/ served Korean content at an unprefixed URL.
  • Verified middleware logic now treats unprefixed docs content routes as root locale and normalizes cookie state before rendering.
  • Ran lsp_diagnostics on packages/web/src/middleware.ts (clean).
  • bun run astro check could not run in this worktree because astro is not installed in the environment.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13756 **State:** open **Merged:** No --- ### What does this PR do? Closes #13606. Closes #13744. Duplicate report: #13754 (closed). Requests to unprefixed docs paths like `/docs/rules/` can still render localized content if a non-root locale cookie is present. This made selecting English in the footer bounce back to Korean content on the same URL. This PR adds middleware handling for unprefixed docs content routes and resets locale to `root` (`oc_locale=en`) when a non-root locale is detected, so `/docs/...` routes consistently render English while keeping locale-prefixed routes (`/docs/ko/...`) unchanged. ### How did you verify your code works? - Reproduced current production behavior with `oc_locale=ko`: `/docs/rules/` served Korean content at an unprefixed URL. - Verified middleware logic now treats unprefixed docs content routes as root locale and normalizes cookie state before rendering. - Ran `lsp_diagnostics` on `packages/web/src/middleware.ts` (clean). - `bun run astro check` could not run in this worktree because `astro` is not installed in the environment.
yindo added the pull-request label 2026-02-16 18:19:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14803