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

ResourceManagement of text in XAML #138

Open
Marv51 opened this issue Nov 26, 2021 · 4 comments
Open

ResourceManagement of text in XAML #138

Marv51 opened this issue Nov 26, 2021 · 4 comments
Labels
sample request New feature sample request

Comments

@Marv51
Copy link

Marv51 commented Nov 26, 2021

The ResourceManagement sample does not show the most common WinUI 3 case for localization: Strings in XAML files.

I was wondering how to use MRT Core with x:Uid attributes. The existence of the two resource systems has me pretty confused.

Should I just stay with "Windows.ApplicationModel.Resources.ResourceLoader"?

@Marv51 Marv51 changed the title ResourceManagement XAML ResourceManagement of XAML strings Nov 26, 2021
@Marv51 Marv51 changed the title ResourceManagement of XAML strings ResourceManagement of text in XAML Nov 26, 2021
@angelazhangmsft
Copy link
Collaborator

@Marv51 - instead of using the Windows.* namepsace, you should migrate to the corresponding Windows App SDK namespaces. Here are docs on Mapping of UWP APIs to Windows App SDK and MRT to MRT Core migration. The example code in the existing UWP docs still applies to WinUI3/Windows App SDK. x:UID works the same as with UWP, so you should only need to change the namespaces.

@angelazhangmsft angelazhangmsft added the sample request New feature sample request label Dec 1, 2021
@HavenDV
Copy link

HavenDV commented Dec 5, 2021

How can I control the language used to get values for x:Uid for unpackaged Desktop apps?

I am trying to make a dynamic language change by re-creating views after changing the language in a ComboBox. In the UWP, I used Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = language; but this is not supported for unpackaged apps

@riverar
Copy link

riverar commented Dec 5, 2021

@angelazhangmsft I'd relabel this as a bug, see discussion at microsoft/WindowsAppSDK#1687 (comment).

There's no way to access the internal MUX ResourceContext to change its qualifiers blocking this scenario.

@huichen123 @andrewleader for 👀

@angelazhangmsft
Copy link
Collaborator

Thanks @riverar for pointing that out!

How can I control the language used to get values for x:Uid for unpackaged Desktop apps?

@HavenDV, we reopened microsoft/WindowsAppSDK#1687 to track that feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sample request New feature sample request
Projects
None yet
Development

No branches or pull requests

4 participants