Expose hotkeys to localisation.#21588
Merged
Merged
Conversation
pchote
reviewed
Sep 21, 2024
PunkPun
reviewed
Sep 22, 2024
PunkPun
reviewed
Sep 22, 2024
abcdefg30
reviewed
Sep 23, 2024
PunkPun
reviewed
Oct 2, 2024
| ret = (Platform.CurrentPlatform == PlatformType.OSX ? "Cmd + " : "Meta + ") + ret; | ||
| ret = $"{ModifiersExts.DisplayString(Modifiers.Meta)} + {ret}"; | ||
|
|
||
| return ret; |
Member
There was a problem hiding this comment.
This should really be called only once and cached . Key is a readonly value
Member
Author
There was a problem hiding this comment.
Not sure that's a worthwhile trade. Caching it would be an expense for callers the create a Hotkey but never call DisplayString - and there's not many callers of DisplayString.
Member
There was a problem hiding this comment.
We don't need to keep keys in memory at all, so I dunno if it's a tradeoff
Member
Author
There was a problem hiding this comment.
I don't understand your comment.
| return k.ToString(); | ||
|
|
||
| return ret; | ||
| return TranslationProvider.GetString(translationKey); |
Member
There was a problem hiding this comment.
This should also be cached, this is only used in Hotkey so might be better to move it there for LoB
27f045d to
a271d3b
Compare
PunkPun
reviewed
Oct 12, 2024
Allows the Settings > Hotkeys screen to be localised, including hotkey decriptions, groups and contexts. The hotkey names are exposed to localisation via KeycodeExts. Hotkey modifiers are similarly exposed via ModifersExts. The Settings > Input screen has a Zoom Modifier dropdown, which shows the localised modifier name. The --check-yaml utility command is taught to recognise all hotkey translation, so it can validate their usage.
a271d3b to
2808753
Compare
Member
Author
PunkPun
approved these changes
Oct 17, 2024
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Allows the Settings > Hotkeys screen to be localised, including hotkey decriptions, groups and contexts.
The hotkey names are exposed to localisation via KeycodeExts. Hotkey modifiers are similarly exposed via ModifersExts.
The Settings > Input screen has a Zoom Modifier dropdown, which shows the localised modifier name.
The --check-yaml utility command is taught to recognise all hotkey translation, so it can validate their usage.