-
Notifications
You must be signed in to change notification settings - Fork 461
Multilanguage support #682
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
Conversation
This way we can add localized strings more easily.
Otherwise we might get different results after each compile which are hard to track for real changes
Summary of ChangesHello @sven-n, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers comprehensive multi-language support, allowing the application to present information and messages in a player's preferred language. It establishes the necessary infrastructure within the data model and game logic to handle localized strings, moving away from hardcoded text. This change significantly improves the accessibility and user experience for a global player base, making the game more adaptable to different linguistic preferences. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a comprehensive localization system across the application, primarily affecting game logic and chat commands. Key changes include adding a LanguageIsoCode property to the Account entity, implementing a ModelResourceProvider for localized captions and descriptions, and integrating PlayerMessage.resx for storing player-facing messages. The Player class now includes Culture information and new methods (GetLocalizedMessage, ShowLocalizedBlueMessageAsync) to display localized messages. Many hardcoded strings in game logic (e.g., mini-game messages, MU Helper messages, duel messages, item consumption feedback) and chat commands have been replaced with calls to these new localization methods, ensuring that messages are displayed in the player's preferred language. Additionally, a new /language chat command has been added to allow players to change their language. The PlugIn attributes across numerous files have been refactored to use the Display attribute for plugin metadata, improving consistency and potentially enabling better UI integration. Error handling in chat commands has been updated to leverage LocalizableExceptionBase for localized error messages. Review comments highlighted issues such as an incorrect method signature for GetLocalizedMessage (fixed to use params object?[]), an illogical condition in SetStatChatCommandPlugIn (attribute.MaximumValue < 0 changed to arguments.Amount < 0), a copy-paste error in a PlugIn attribute description (EndDuelWhenLeavingDuelMapPlugIn), and the need to localize a quest progress message in QuestMonsterKillCountPlugIn.
src/GameLogic/PlayerActions/Duel/EndDuelWhenLeavingDuelMapPlugIn.cs
Outdated
Show resolved
Hide resolved
Instead, we log the message
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.
Code Review
This is an impressive and extensive pull request that introduces multi-language support across the application. The changes are largely systematic and well-executed. Key improvements include:
- The introduction of a
LocalizedStringtype and its widespread adoption for localizable strings in the data model. - The addition of resource files for player messages and plugin metadata, which is a solid foundation for localization.
- A significant and valuable refactoring of chat commands to be more robust, user-friendly, and provide localized feedback.
- The ability for players to select their preferred language, which is stored in their account.
I have one main point of feedback regarding the use of ToString() on LocalizedString instances, which could lead to incorrect localizations in a server environment. Please see the detailed comment.
AccountWill be done in following PRs:
Not needed for now: