Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreTextServicesManager.InputLanguage returns wrong language #2431

Open
DJm00n opened this issue Dec 2, 2023 · 3 comments
Open

CoreTextServicesManager.InputLanguage returns wrong language #2431

DJm00n opened this issue Dec 2, 2023 · 3 comments
Assignees
Labels
Pri2 Topic is in the second 25% of page views for the repo. uwp/prod Topic product is UWP-related. winrt-reference/tech Topic technology is WinRT-related.

Comments

@DJm00n
Copy link
Contributor

DJm00n commented Dec 2, 2023

I have found that Windows.UI.Text.Core.CoreTextServicesManager.InputLanguage.LanguageTag may return wrong input language that is not the same as returned from Windows.Globalization.Language.CurrentInputMethodLanguageTag. It is wrong in case of some transient input languages (that doesn't have LCID).

It seems there is same issue as I have already reported with LCIDToLocaleName API. LCIDToLocaleName returns same wrong language tags when I tried to convert transient LCID to a language tag.

It could be easily reproduced like this:

 Windows::UI::Text::Core::CoreTextServicesManager::GetForCurrentView()->InputLanguageChanged +=
        ref new TypedEventHandler<Windows::UI::Text::Core::CoreTextServicesManager ^, Platform::Object ^>(this, &SDL_WinRTApp::OnLanguageChanged);

....

void SDL_WinRTApp::OnLanguageChanged(Windows::UI::Text::Core::CoreTextServicesManager ^ sender, Platform::Object ^ args)
{
    Windows::Globalization::Language ^ language = sender->InputLanguage;
    Windows::Globalization::Language ^ language2 = ref new Windows::Globalization::Language(Windows::Globalization::Language::CurrentInputMethodLanguageTag);
}
image image image

What Get-WinUserLanguageList PowerShell cmdlet returns:

image

Also reported here: dotnet/runtime#82367


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@issues-automation issues-automation bot added Pri2 Topic is in the second 25% of page views for the repo. uwp/prod Topic product is UWP-related. winrt-reference/tech Topic technology is WinRT-related. labels Dec 2, 2023
@DJm00n DJm00n changed the title Windows.UI.Text.Core.CoreTextServicesManager.InputLanguage may return wrong language CoreTextServicesManager.InputLanguage returns wrong language Dec 2, 2023
@DJm00n
Copy link
Contributor Author

DJm00n commented Dec 6, 2023

@Karl-Bridge-Microsoft can you please take a look?

@Karl-Bridge-Microsoft Karl-Bridge-Microsoft self-assigned this Dec 13, 2023
@DJm00n
Copy link
Contributor Author

DJm00n commented Jan 20, 2024

Hey @Karl-Bridge-Microsoft! Do you have any updates on this topic?

@DJm00n
Copy link
Contributor Author

DJm00n commented May 24, 2024

@Karl-Bridge-Microsoft any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pri2 Topic is in the second 25% of page views for the repo. uwp/prod Topic product is UWP-related. winrt-reference/tech Topic technology is WinRT-related.
Projects
None yet
Development

No branches or pull requests

2 participants