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

Example for Language Change #6

Closed
AntonioNusco opened this issue May 19, 2023 · 2 comments
Closed

Example for Language Change #6

AntonioNusco opened this issue May 19, 2023 · 2 comments

Comments

@AntonioNusco
Copy link

I implemented everything correctly and the text changes according to the initial value of the language. Now I should make the app change the language in runtime on clicking a MenuFlyoutItem, could I have an example? the app is packaged and not built with TemplateStudio

@AntonioNusco
Copy link
Author

ok, i solved doind this

In the Page.xaml.cs
private void selectLanguage(object sender, RoutedEventArgs e) { App.localizer.SetLanguage("en-US"); }

And in the App.xaml.cs i have changed this
public static ILocalizer localizer { get; set; } localizer = await new LocalizerBuilder() .AddStringResourcesFolderForLanguageDictionaries(stringsFolder.Path) .SetOptions(options => { options.DefaultLanguage = "it-IT"; options.UseUidWhenLocalizedStringNotFound = true; }) .Build();

@AndrewKeepCoding
Copy link
Owner

Great! Let me know if you have any other question.😁

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

2 participants