* If locale data cannot be found for a particular locale and its not english, fall back to English by calling getCharacterDescription this time with 'en'.
* If a character description can not be found in the locale data for a given locale, and its not english, fall back to English by calling getCharacterDescription with 'en'.
* If a character description can not be found in the english locale, instead look up the name in the unicode database. The unicode database is only available in english, however I think it is a useful fall back when there is nothing else to say.
* Finally if absolutely nothing can be found, then None is returned, which means that NVDA will just use the character itself.
@return: the found description for the given character\r
@rtype: string\r
"""\r
- l=_charDescLocaleDataMap.fetchLocaleData(locale)\r
+ try:\r
+ l=_charDescLocaleDataMap.fetchLocaleData(locale)\r
+ except LookupError:\r
+ if not locale.startswith('en'):\r
+ return getCharacterDescription('en',character)\r
+ raise LookupError("en")\r
desc=l.getCharacterDescription(character)\r
+ if not desc:\r
+ if not locale.startswith('en'):\r
+ desc=getCharacterDescription('en',character)\r
+ else:\r
+ import unicodedata\r
+ try:\r
+ desc=unicodedata.name(character)\r
+ except ValueError:\r
+ return None\r
return desc\r
\ No newline at end of file