From 807f52e8b56bbcd907cee88146f0d3ae3a22206d Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Fri, 12 Aug 2016 00:26:35 -0700 Subject: [PATCH] Language handler: Aragonese is no longer displayed as 'unknown language'. re #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). --- source/languageHandler.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/languageHandler.py b/source/languageHandler.py index d37f4bccc81..e48d2adcca1 100644 --- a/source/languageHandler.py +++ b/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 @@ -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, 4096): 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: