-
-
Notifications
You must be signed in to change notification settings - Fork 368
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.
📝 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
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ 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 (
|
@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 ...
|
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);
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