How to set InputLanguage?

Ask general questions here.
harry
Posts: 2
Joined: Thu Nov 03, 2016 10:34 am

How to set InputLanguage?

Post by harry » Thu Nov 03, 2016 11:06 am

I want to set "en-us" as the input language at the beginning of the test case. So I tried follow code:

Code: Select all

[language=C#]
foreach (InputLanguage inputLanguage in InputLanguage.InstalledInputLanguages)
            {
                if (inputLanguage.Culture.Name.IndexOf("en") >= 0)
                {
                    InputLanguage.CurrentInputLanguage = inputLanguage;
                    break;
                }
            }
[/language]
when I only run the code module, the input language set successful. But when I run the whole test case, the input language could not be set anymore. :shock: I can not find a way to workaround. What is the problem?

Thanks,

harry
Posts: 2
Joined: Thu Nov 03, 2016 10:34 am

Re: How to set InputLanguage?

Post by harry » Wed Nov 09, 2016 10:29 am

I found a workaround finally. I can use per application input language (in win10 language setting) and the default language to solve my issue.

Thanks, :D