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

Handle Multi Lang Strings in XAML base C++ WinRT Unpackaged application #1476

Open
mdnchauhan opened this issue Feb 26, 2025 · 3 comments
Open

Comments

@mdnchauhan
Copy link

Version

Microsoft.Windows.CppWinRT version 2.0.240405.15

Summary

My application is - WinUI3 XAML based C++WinRT, Unpackaged App
for handling MultiLanguages strings, I am implementing .resw files.

There are two resw files

  1. Strings/en-US/Resources.resw
Englishtext
  1. Strings\pl-PL\Resources.resw
Polish text

XAML

Problem :- I get the text of the Lang which is set as Preferred Lang in settings.
If it is a Polish machine and user has changed the "Preferred Languages" to English instead of Polish. (Settings -> Time&Language -> Lang & Region -> Preferred Languages ), then it picks English string NOT the Polish one.

Is there any way to set the Language as per our need in c++ WinRT app in such a way that my app will pick Polish text only... irrespective of what is set as Default Preferred lang.

Thanks,
MChauhan

Reproducible example

Expected behavior

No response

Actual behavior

No response

Additional comments

No response

@jaigak
Copy link
Contributor

jaigak commented Feb 26, 2025

Override the application language by setting the Windows::Globalization::ApplicationLanguages.PrimaryLanguageOverride property.

@sylveon
Copy link
Contributor

sylveon commented Feb 26, 2025

Their app is unpackaged WinUI 3. This property doesn't work.

This question should be asked on the WinUI 3 repo.

@mdnchauhan
Copy link
Author

Their app is unpackaged WinUI 3. This property doesn't work.

This question should be asked on the WinUI 3 repo.

Yes, our application is Unpackaged.
I tried to set DefaultLang by using winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride but it throws exception message "The process has no package identity".

As per your suggestion, I will post this question on WinUI3.

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

No branches or pull requests

3 participants