-
Notifications
You must be signed in to change notification settings - Fork 10.4k
multilang: fix missing translation for longitudinal personality toggle description #36446
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: master
Are you sure you want to change the base?
multilang: fix missing translation for longitudinal personality toggle description #36446
Conversation
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 fixes a missing translation for the longitudinal personality setting's description text. The change ensures that the description is properly translated like other UI elements by wrapping it in a lambda function that calls the translation function.
Key Changes:
- Added translation wrapper to the longitudinal personality toggle description to ensure it's translated consistently with other UI strings
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| self._long_personality_setting = multiple_button_item( | ||
| lambda: tr("Driving Personality"), | ||
| DESCRIPTIONS["LongitudinalPersonality"], | ||
| lambda: tr(DESCRIPTIONS["LongitudinalPersonality"]), |
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.
We should translate below?
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.
It doesn't because it's not included in self._toggle_defs (it's shown conditionally)
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.
Wait, it looks like it's still included in the loop, let me check
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.
It is excluded since it's a multiple_button_item instead of toggle_item. The toggle is added to _toggles further down, but not _toggle_defs
I found a way to include it though, but with a bit more code due to the difference.
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.
Alright, #36461 might be considered a more proper solution, although the simplicity of this pr can't be matched. Whichever one you like better.


























This setting is added separately, so it wasn't being translated when all the others are.
Wrapped in lamba to be consistent, but all the ones in this class seem to work fine without the lambda, so curious why this is necessary.
Before:

After:
