Skip to content

Handle unknown languages with fallback messaging#620

Merged
narumincho merged 7 commits intomainfrom
codex/lang
Mar 15, 2026
Merged

Handle unknown languages with fallback messaging#620
narumincho merged 7 commits intomainfrom
codex/lang

Conversation

@narumincho
Copy link
Owner

Summary

  • fix the build error that occurred during the previous run attempt
  • add fallback language detection (using ?lang=, then Accept-Language, then English) and show a message in the dropdown when an unsupported language like “unknown” is requested
  • update related UI components to expose the new language fallback notification

Testing

  • Not run (not requested)

@narumincho narumincho linked an issue Mar 15, 2026 that may be closed by this pull request
7 tasks
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 943b6f3ff9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if query.is_empty() {
return QueryParams::default();
}
let mut params = serde_urlencoded::from_str::<QueryParams>(query).unwrap_or_default();

Choose a reason for hiding this comment

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

P2 Badge Preserve lang when other query fields fail to parse

parse_query deserializes the whole query string into QueryParams and falls back to default() on any error, so a URL like /?lang=ja&event_type=invalid drops the valid lang value as well. Because lang_redirect_url in definy-server/src/main.rs checks parse_query(...).lang.is_some(), this path is treated as “missing lang” and can redirect to a different language based on Accept-Language, which is surprising for users who explicitly requested lang=ja. Parsing lang independently (or making event_type deserialization non-fatal) would avoid this regression.

Useful? React with 👍 / 👎.

Refactor wait_for_url to use a helper that treats the expected URL as matching the current URL even when a query or fragment is appended. Adds url_matches_expected helper and a unit test (wait_url_match_allows_query_or_fragment) to validate exact matches and matches with ? or #, while rejecting different paths.
@narumincho narumincho merged commit fea2b88 into main Mar 15, 2026
1 check passed
@narumincho narumincho deleted the codex/lang branch March 15, 2026 10:37
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.

多言語対応

1 participant