Skip to content

Commit 0ce1c3d

Browse files
authored
Merge ccd54e9 into c759d40
2 parents c759d40 + ccd54e9 commit 0ce1c3d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

source/config/configFlags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
DisplayStringStrEnum,
1818
DisplayStringIntFlag,
1919
)
20-
from keyLabels import localizedKeyLabels
2120

2221

2322
@unique
@@ -36,6 +35,8 @@ class NVDAKey(DisplayStringIntFlag):
3635

3736
@property
3837
def _displayStringLabels(self):
38+
# Imported lazily since this module is imported before gettext translation is installed.
39+
from keyLabels import localizedKeyLabels
3940
return {
4041
NVDAKey.CAPS_LOCK: localizedKeyLabels['capslock'],
4142
NVDAKey.NUMPAD_INSERT: localizedKeyLabels['numpadinsert'],

source/keyLabels.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
#See the file COPYING for more details.
55
#Copyright (C) 2008-2016 NV Access Limited, Aleksey Sadovoy, Babbage B.v.
66

7+
"""Contains mapping from the Windows key names to their localized labels.
8+
9+
As there are localizable strings at module level,
10+
this can only be imported once localization is set up via `languageHandler.initialize`.
11+
"""
12+
13+
714
localizedKeyLabels = {
815
# Translators: This is the name of the back key found on multimedia keyboards for controlling the web-browser.
916
'browserback': _("back"),

0 commit comments

Comments
 (0)