Skip to content

Language handler: use kernel32.dll's LocaleNameToLCID function directly #8488

@josephsl

Description

@josephsl

Hi,

Continuing series of work designed to let NVDA take advantage of features introduced in Windows 7 and later:

Background

In language handler, NVDA assumes it supports Windows XP. Specifically, when retrieving LCID/language description, it'll first check the existence of kernel32.dll's LocaleNameToLCID function, and if not, it'll look up locale names provided by Python's locale.windows_locale dictionary.

However, in August 2017, NV Access announced end of support for Windows versions earlier than 7 SP1. As a result, since NVDA 2017.4, consulting locale.windows_locale is no longer necessary (dead code).

Steps to reproduce:

From Python Console, do:
import languageHandler; languageHandler.getLanguageDescription("en")

Also, on Windows 7 SP1 and later, with Python Console open, do:
import winKernel; winKernel.kernel32.LocaleNameToLCID

Actual behavior:

The first fragment gives no errors unless the locale name is soething NVDA doesn't know about. For the second fragment, a function pointer is returned.

Expected behavior:

For the first fragment, NVDA returns nothing if it doens't know about a locale passed into that function. For the second fragment, a function pointer is returned.

System configuration:

NVDA Installed/portable/running from source:

Installed

NVDA version:

Alpha.15495

Windows version:

Windows 7, 8.1, 10 (various releases)

Name and version of other software in use when reproducing the issue:

N/A

Other information about your system:

N/A

Other questions:

Does the issue still occur after restarting your PC?

N/A (not applicable as this is a design change)

Have you tried any other versions of NVDA?

N/A (not applicable, as it is a recent change)

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions