Skip to content

Fix incorrect system language#4519

Merged
Jack251970 merged 1 commit into
devfrom
system_language
Jun 8, 2026
Merged

Fix incorrect system language#4519
Jack251970 merged 1 commit into
devfrom
system_language

Conversation

@Jack251970

@Jack251970 Jack251970 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Fix #4518


Summary by cubic

Ensure system language detection stops on the first match to prevent overwriting and select the correct language. Fixes incorrect language selection in some cases (issue #4518).

  • Summary of changes

    • Changed: Added an early return in InitSystemLanguageCode after setting SystemLanguageCode to stop further checks.
    • Added: Early-exit logic to lock in the first valid match and avoid later overwrites.
    • Removed: Implicit behavior where later iterations could overwrite SystemLanguageCode.
    • Memory: No impact; minor CPU reduction from fewer iterations.
    • Security: No risks.
    • Tests: No new unit tests added.
  • Release Note
    Fixes a bug that could set the app to the wrong language on startup.

Written for commit 9721804. Summary will update on new commits.

Review in cubic

Ensure method exits immediately after finding a matching language code to prevent unnecessary checks and potential overwriting of SystemLanguageCode.
Copilot AI review requested due to automatic review settings June 8, 2026 10:36
@github-actions github-actions Bot added this to the 2.2.0 milestone Jun 8, 2026
@Jack251970 Jack251970 enabled auto-merge June 8, 2026 10:36
@Jack251970 Jack251970 requested a review from DavidGBrett June 8, 2026 10:36
@Jack251970 Jack251970 added the bug Something isn't working label Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the startup language selection when the user chooses “System” by preventing the detected system language code from being overwritten with the default language after a successful match.

Changes:

  • Exit early from InitSystemLanguageCode() once a matching system language is found, preserving the matched language code.
  • Keep the default fallback (en) only for the no-match case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8fcc4a1-8273-4888-9845-7d6bb5067600

📥 Commits

Reviewing files that changed from the base of the PR and between 447fbea and 9721804.

📒 Files selected for processing (1)
  • Flow.Launcher.Core/Resource/Internationalization.cs

📝 Walkthrough

Walkthrough

A single-line change adds an early return statement to the InitSystemLanguageCode method after successfully setting the system language code. This prevents the loop from continuing to execute and overwriting the matched language code with the default code on application startup.

Changes

System Language Code Initialization

Layer / File(s) Summary
System language initialization early return
Flow.Launcher.Core/Resource/Internationalization.cs
After finding and setting a matching system language code, the method returns immediately to prevent the loop from overwriting it with the default code.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • jjw24
  • taooceros
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing incorrect system language detection by adding an early return after finding the first matching language code.
Description check ✅ Passed The description is well-related to the changeset, explaining the problem, the fix applied, and its impact on system language selection.
Linked Issues check ✅ Passed The pull request addresses issue #4518 by implementing the fix that prevents SystemLanguageCode from being overwritten by adding an early return after the first valid match.
Out of Scope Changes check ✅ Passed The change is focused and directly addresses the issue: adding an early return in InitSystemLanguageCode to stop iteration after finding the first matching language.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch system_language

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Flow.Launcher.Core/Resource/Internationalization.cs

@DavidGBrett DavidGBrett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!
Thank you for the fix!

@Jack251970 Jack251970 merged commit eb3da1e into dev Jun 8, 2026
7 checks passed
@Jack251970 Jack251970 deleted the system_language branch June 8, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Incorrect language on startup when using system

3 participants