-
Notifications
You must be signed in to change notification settings - Fork 179
multi language translation #443
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: Development
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ogExperts/LogExpert into 224-multi-language-translation
Co-authored-by: Copilot <[email protected]>
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 introduces multi-language translation support for LogExpert with resource-based localization using structured key naming conventions.
- Implements a comprehensive resource key naming system with patterns for UI components, logger messages, and common elements
- Adds culture-specific functionality with language selection in settings and proper culture initialization
- Refactors hardcoded strings throughout the application to use resource keys with proper error handling and exception specificity
Reviewed Changes
Copilot reviewed 41 out of 50 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
src/LogExpert/Program.cs | Main application entry point with culture initialization and comprehensive error handling using resources |
src/LogExpert/Config/ConfigManager.cs | Configuration management updated to use resource keys and support default language settings |
src/LogExpert/Classes/LogExpertProxy.cs | Proxy class updated with resource-based logging messages |
src/LogExpert/Classes/LogExpertApplicationContext.cs | Application context with platform-specific attributes added |
src/LogExpert.sln | Solution file updated to include README.md |
src/LogExpert.UI/LogExpert.UI.csproj | Project file cleanup removing SubType specification |
Multiple UI files | Extensive refactoring of UI components to use resource keys and improved error handling |
Files not reviewed (5)
- src/LogExpert.Resources/Resources.de.Designer.cs: Language not supported
- src/LogExpert.UI/Controls/DateTimeDragControl.Designer.cs: Language not supported
- src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs: Language not supported
- src/LogExpert.UI/Dialogs/Eminus/EminusConfigDlg.Designer.cs: Language not supported
- src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.designer.cs: Language not supported
|
||
PluginRegistry.PluginRegistry.Instance.Create(ConfigManager.Instance.ConfigDir, ConfigManager.Instance.Settings.Preferences.PollingInterval); | ||
SetCulture(); | ||
|
||
_ = PluginRegistry.PluginRegistry.Instance.Create(ConfigManager.Instance.ConfigDir, ConfigManager.Instance.Settings.Preferences.PollingInterval); | ||
|
Copilot
AI
Jul 17, 2025
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.
The SetCulture() method is called before plugin registry initialization, but it depends on ConfigManager.Instance.Settings which may not be fully initialized yet. Consider moving SetCulture() after the plugin registry initialization or adding null checks.
Copilot uses AI. Check for mistakes.
return true; | ||
} | ||
|
||
//intentional fall-through for all other keys |
Copilot
AI
Jul 17, 2025
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.
The massive switch statement with 340+ empty case blocks is unnecessary and makes the code difficult to maintain. Consider removing all the empty cases and just use the default case, or implement specific logic only for the cases that need it.
Copilot uses AI. Check for mistakes.
DataGridViewAdvancedCellBorderStyle.None => 0, | ||
DataGridViewAdvancedCellBorderStyle.InsetDouble or DataGridViewAdvancedCellBorderStyle.OutsetDouble => 2, | ||
_ => 1 | ||
DataGridViewAdvancedCellBorderStyle.NotSet => 0, // Default border size for NotSet | ||
DataGridViewAdvancedCellBorderStyle.Single => 0, // Default border size for Single | ||
DataGridViewAdvancedCellBorderStyle.Inset => 0, // Default border size for Inset | ||
DataGridViewAdvancedCellBorderStyle.Outset => 0, // Default border size for Outset | ||
DataGridViewAdvancedCellBorderStyle.OutsetPartial => 0, // Default border size for OutsetPartial |
Copilot
AI
Jul 17, 2025
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.
[nitpick] The switch expression has multiple cases that all return 0, but they are explicitly listed with comments. This could be simplified by grouping them or using a more concise approach.
Copilot uses AI. Check for mistakes.
|
||
settings.Preferences.DefaultEncoding ??= Encoding.Default.HeaderName; | ||
|
||
settings.Preferences.DefaultLanguage ??= CultureInfo.GetCultureInfo("en-US").Name; |
Copilot
AI
Jul 17, 2025
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.
The default language is hardcoded as 'en-US'. Consider using a constant or configuration value to make this more maintainable and configurable.
settings.Preferences.DefaultLanguage ??= CultureInfo.GetCultureInfo("en-US").Name; | |
const string DEFAULT_LANGUAGE = "en-US"; | |
settings.Preferences.DefaultLanguage ??= CultureInfo.GetCultureInfo(DEFAULT_LANGUAGE).Name; |
Copilot uses AI. Check for mistakes.
|
||
private readonly Image _emptyImage = new Bitmap(16, 16); | ||
private readonly LogTabWindow _logTabWin; | ||
private const string DEFAULT_FONT_NAME = "Courier New"; |
Copilot
AI
Jul 17, 2025
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.
[nitpick] The default font name is hardcoded. Consider making this configurable or using system defaults to improve cross-platform compatibility.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ogExperts/LogExpert into 224-multi-language-translation # Conflicts: # src/LogExpert.UI/Dialogs/HighlightDialog.cs
this pr introduces multi language translation
Examples: