fix: locale_selector reads stripped path, set-language ignores session#1610
Merged
Conversation
#1606, #1607) locale_selector re-parsed scope["path"] which LangPrefixMiddleware had already stripped, so URL-prefix locale detection never worked. Now reads from scope["state"]["lang_prefix"] instead. The /set-language endpoint only set the cookie but not the session preference, so authenticated users could never switch language (session always won over cookie). Now updates session["user"]["settings"]["language"] too. Fixes #1606 Fixes #1607 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davidpoblador
pushed a commit
that referenced
this pull request
Apr 8, 2026
🤖 I have created a release *beep* *boop* --- ## [10.3.0](v10.2.1...v10.3.0) (2026-04-08) ### Features * add CI Docker build and push workflow to scaffolding ([#1615](#1615)) ([90fabab](90fabab)) ### Bug Fixes * locale_selector reads stripped path, set-language ignores session ([#1610](#1610)) ([0859f7f](0859f7f)) * pin claude-code-action to v1.0.88 to avoid symlink ENOENT bug ([#1613](#1613)) ([b8846bb](b8846bb)) * use PyPI package for lint-po instead of git+https ([#1609](#1609)) ([12fa28a](12fa28a)) ### Miscellaneous Chores * **deps:** bump pytest from 9.0.2 to 9.0.3 in /vibetuner-py ([#1605](#1605)) ([c99e9f3](c99e9f3)) * remove /update-scaffolding skill from scaffolded projects ([#1617](#1617)) ([d4dd174](d4dd174)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
locale_selector()re-parsedscope["path"]whichLangPrefixMiddlewarehadalready stripped, so URL-prefix locale detection (
/ca/...) never worked. Now reads fromscope["state"]["lang_prefix"]instead./set-language/{lang}only set the cookie but didn't updatesession["user"]["settings"]["language"], so authenticated users couldn't switch language(session preference always won over cookie). Now updates both.
Fixes #1606
Fixes #1607
Test plan
locale_selector(5 tests)🤖 Generated with Claude Code