Skip to content

Commit

Permalink
In the list of languages in NVDA's General Settings dialog, languages…
Browse files Browse the repository at this point in the history
… such as Aragonese are now displayed correctly on Windows 10. (#6259)

According to MSDN, LCID 0x1000 (4096) is treated as a custom locale by users. This affected how Aragonese entry is presented in General Settings/language combo box (in Windows 10, it shows up as 'unknown language'). Thus take care of this case.
Also took this time to add needed copyright headers (based on git log archive).
PR #6261.
  • Loading branch information
josephsl authored and jcsteh committed Oct 18, 2016
1 parent e6b9923 commit 9caafa1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/languageHandler.py
@@ -1,3 +1,9 @@
#languageHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2007-2016 NV access Limited, Joseph Lee
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

import __builtin__
import os
import sys
Expand Down Expand Up @@ -38,7 +44,9 @@ def getLanguageDescription(language):
"""Finds out the description (localized full name) of a given local name"""
desc=None
LCID=localeNameToWindowsLCID(language)
if LCID!=0:
# #6259: LCID 0x1000 denotes custom locale in Windows 10, thus returns "unknown language" or an odd description (observed for Aragonese).
# See https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.lcid(v=vs.110).aspx.
if LCID not in (0, 0x1000):
buf=ctypes.create_unicode_buffer(1024)
#If the original locale didn't have country info (was just language) then make sure we just get language from Windows
if '_' not in language:
Expand Down

0 comments on commit 9caafa1

Please sign in to comment.