Skip to content

fix(web): sync docs locale cookie on alias redirects#13109

Merged
adamdotdevin merged 1 commit intoanomalyco:devfrom
Seungjun0906:fix/docs-en-locale-cookie-sync
Feb 13, 2026
Merged

fix(web): sync docs locale cookie on alias redirects#13109
adamdotdevin merged 1 commit intoanomalyco:devfrom
Seungjun0906:fix/docs-en-locale-cookie-sync

Conversation

@Seungjun0906
Copy link
Contributor

@Seungjun0906 Seungjun0906 commented Feb 11, 2026

Closes #13108 #13078 #13057

What does this PR do?

This fixes docs locale reversion when users explicitly navigate via locale aliases (especially /docs/en) while an existing non-English oc_locale cookie is set.
I updated docs middleware to set oc_locale on alias redirects, and normalize root English to oc_locale=en.
I also synced locale changes to oc_locale in app language context so cookie/state stay aligned.
Why this works: docs routing reads oc_locale when deciding redirects from /docs. If cookie and user-selected locale drift, users can bounce back to a previous non-English locale. Keeping cookie synchronized removes that drift.
Note: production /docs/en returning 404 appears to be a front-door routing issue. This PR improves locale consistency once requests reach app/docs logic.

How did you verify your code works?

  • Reproduced and checked behavior locally with oc_locale set to non-English values (not only ko).
  • Verified /docs/ alias redirect behavior and cookie updates in local docs middleware flow.
  • Confirmed changed files are:
    • packages/web/src/middleware.ts
    • packages/app/src/context/language.tsx
  • Checked production headers for context:
    • /docs/en returns 404
    • /docs returns 200

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

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.

/docs/en returns 404 in production and English selection reverts to previous non-English locale

2 participants