Skip to content

Support automatic language switching in Microsoft Edge and other UI Automation text implementations #6853

Merged
michaelDCurran merged 3 commits into
masterfrom
i6852
Mar 14, 2017
Merged

Support automatic language switching in Microsoft Edge and other UI Automation text implementations #6853
michaelDCurran merged 3 commits into
masterfrom
i6852

Conversation

@michaelDCurran

@michaelDCurran michaelDCurran commented Feb 8, 2017

Copy link
Copy Markdown
Member

A part from exposing language information from UI Automation text formatting, this PR also supports mappings of all Windows primary language locale identifiers to locale names. This has been manually calculated from locale.windows_locale. Oddly windows_locale does not contain them directly.

Both UI Automation and ITextDocument may expose these primary language locale identifiers if country specific information is not available.

For example, the html

<p lang="de">

exposes LCID 0x7 (German) as opposed to

<p lang="de-DE">

which exposes 0x407 (German, Germany).

This also should provide a more complete fix for #6611 as that was caused due to values such as 0x09 (English) missing from the mapping.

Fixes #6852

…ale identifiers to locale names. This has been manually calculated from locale.windows_locale. Oddly windows_locale does not contain them directly.

Both UI Automation and ITextDocument may expose these primary language locale identifiers if country specific information is not available.
For example, the html <p lang="de"> exposes LCID 0x7 (German) as opposed to <p lang="de-DE"> which exposes 0x407 (German, Germany).
Comment thread source/NVDAObjects/UIA/__init__.py Outdated
annotationTypes=getUIATextAttributeValueFromRange(range,UIAHandler.UIA_AnnotationTypesAttributeId,ignoreMixedValues=ignoreMixedValues)
if annotationTypes==UIAHandler.AnnotationType_SpellingError:
formatField["invalid-spelling"]=True
val=getUIATextAttributeValueFromRange(range,UIAHandler.UIA_CultureAttributeId,ignoreMixedValues=ignoreMixedValues)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think val could have a better name. Perhaps cultureCodeVal.

michaelDCurran added a commit that referenced this pull request Feb 10, 2017
@michaelDCurran michaelDCurran merged commit db11e37 into master Mar 14, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.2 milestone Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support automatic language switching in Microsoft Edge

3 participants