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
Cannot set language to Serbian (Latin) on newer Windows versions #4203
Comments
Comment 1 by mdcurran on 2014-06-17 23:25 |
Comment 2 by Michael Curran <mick@... on 2014-06-19 01:27
Changes:
|
Comment 3 by Michael Curran <mick@... on 2014-07-07 09:05
Changes:
|
Comment 4 by mdcurran on 2014-07-07 09:06 |
Summary of the issue: The latest PR (#13338) to merge beta to master has failed, due to Bangla translations being introduced and windowsPrimaryLCIDsToLocaleNames not listing the locale. AppVeyor build failure. On #13339, @CyrilleB79 raised that this variable is poorly documented and outdated. The initial variable provided a mapping of LCIDs to language codes, without the rest of the locale. We now normalize the locale as necessary in normalizeLanguage instead. On further inspection, it appears that the only additions from locale.windows_locale are as follows: { 1170: 'ckb', 1109: 'my', 1143: 'so', + 2117: 'bn', 9242: 'sr', } As locale.windows_locale is incomplete, these were introduced to ensure languages translated in NVDA could be mapped. Instead, the Windows function LCIDToLocaleName can be used to get each of these locales. This was suggested in #4203. However Windows maps 1170 to "ku-Arab-IQ" not "ckb", and a translation is added for Central Kurdish in localesData.LANG_NAMES_TO_LOCALIZED_DESCS["ckb"]. NVDA may drop "Arab-IQ" from this locale to get the language, losing the locality of "Central Kurdish". Description of how this pull request fixes the issue: Removes windowsPrimaryLCIDsToLocaleNames, instead use LCIDToLocaleName after checking for an internal mapping (eg for "ckb").
Reported by mdcurran on 2014-06-17 22:49
It seems that in Windows 8, and possibly earlier it is impossible to run NVDA on a machine with the user language set to Serbian (Latin) (LCID 0x241a) where the NVDA language is 'Windows'. as this LCID does not exist in Python's locale.windows_locale. In fact a KeyError is raised and NVDA fails to initialize.
We should catch KeyError when looking up the LCID, and fallback to using LCIDToLocaleName if this function is available. Eventually we should consider using this before using locale.windows_locale, but this could be a breaking change so for now we should only fall back to it.
The text was updated successfully, but these errors were encountered: