Import keyLabels only after translation is initialized to make the labels displayed in the user's language#14658
Merged
Conversation
…bels displayed in the user's language
Contributor
Author
|
CC @CyrilleB79 You may want to review this PR. |
seanbudd
approved these changes
Feb 21, 2023
See test results for failed build of commit 0ce1c3d87a |
CyrilleB79
approved these changes
Feb 21, 2023
CyrilleB79
left a comment
Contributor
There was a problem hiding this comment.
Thanks @lukaszgo1 for having noticed this issue and for your fix.
See test results for failed build of commit b47f4fce56 |
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.
Opened against beta, since this pull request fixes regression which ideally should not get into the release.
Link to issue number:
Fixes #14657
Summary of the issue:
In pull request #14528
keyLabelswere imported pretty early during NVDA's startup. Since this module contains localized strings at the module level these are translated beforelanguageHandleris initialized. This means that they're translated either to the default language of the system, or for locales for which Python'slocale.getdefaultlocalefails they remain in English, disregarding the language set in preferences.Description of user facing changes
Key labels are once again presented in the language set in preferences.
Description of development approach
keyLabelsare imported lazily in theconfigFlagskeyLabelsmodule explaining when it can be safely imported.Testing strategy:
On a English Windows set NVDA's language to Polish, ensured that key labels in the keyboard help and in the preferences are displayed in Polish.
Known issues with pull request:
While this pull request fixes this particular issue I'm of the opinion that we should not initialize a fake translation before parsing user's configured language. Since this would be bigger change, unsuitable for the beta branch at this stage, I'm going to open a separate issue to discuss and track this. Edit: I've created #14660
Change log entries:
None needed - unreleased regression
Code Review Checklist: