-
-
Notifications
You must be signed in to change notification settings - Fork 377
Fix WinForm Culture Info Issue #3566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
🥷 Code experts: no user but you matched threshold 10 Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
This comment has been minimized.
This comment has been minimized.
Warning Rate limit exceeded@Jack251970 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 22 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 Walkthrough""" WalkthroughThe changes refactor language code and culture initialization, moving system language setup and culture info application to explicit static methods. Application settings loading and error handling are shifted from the constructor to the static Main method, ensuring localization is configured before app instantiation. Font resource assignment is updated with null checks for safety. Changes
Sequence Diagram(s)sequenceDiagram
participant Main as Main()
participant Settings as Settings
participant Intl as Internationalization
participant App as App()
Main->>Settings: Load()
alt On error
Main->>Main: Show error message and terminate
end
Main->>Intl: InitSystemLanguageCode()
Main->>Intl: ChangeCultureInfo(Settings.Language)
Main->>App: Create App instance
App->>Settings: Use already loaded settings
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures WinForm windows are localized by loading user settings and setting the culture before creating the application, and adds early initialization for DI and UI resources.
- Move settings load from the
App
constructor toMain
and callInitSystemLanguageCode
/ChangeCultureInfo
before application startup - Refactor error handling into a static
ShowErrorMsgBoxAndFailFast
method - Update
Settings
to initialize DI services and theme fonts, and adjust culture-change logic inInternationalization
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
Flow.Launcher/App.xaml.cs | Load settings and set culture in Main , replace local error helper with a static method |
Flow.Launcher.Infrastructure/UserSettings/Settings.cs | Add Settings.Initialize to wire up DI services and apply font resources, and update font setter |
Flow.Launcher.Core/Resource/Internationalization.cs | Introduce InitSystemLanguageCode and ChangeCultureInfo , streamline culture assignment logic |
Comments suppressed due to low confidence (1)
Flow.Launcher.Core/Resource/Internationalization.cs:175
- [nitpick] There are no existing tests covering the culture initialization and plugin metadata translation flow; consider adding unit or integration tests for
InitSystemLanguageCode
,ChangeCultureInfo
, andUpdatePluginMetadataTranslations
.
await Task.Run(UpdatePluginMetadataTranslations);
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
Fix WinForm Culture Info Issue
For WinForm localization, we need to set culture info before creating application so that WinForm can follow the set language. This is helpful for plugins with WinForm windows.
To implement this, we also need to initialize settings so that we can get language code and initialize system language before changing culture info.
Test