Reputation: 551
I have to localize an W8 C# application. The user must be able to change the language in runtime.
I tried to used :
Windows.Globalization.ApplicationLanguages.PromaryLanguageOverride = "de-DE";
and reload the Frame with :
var _Frame = Windo.Current.Content as Frame;
_Frame.Navigate(_Frame.Content.GetType());
_Frame.GoBack();
It had no effect in runtime but it works when I restart the application.
What can I do to make it works in runtime ?
My app had only images in folders like "en-US"; "de-DE"; "fr-FR"...
The Package.appxmanifest has this property :
<Ressource Language="x-generate" />
I already tried to specify each languages :
<Resources>
<Resource Language="en-US" />
<Resource Language="fr-FR" />
<Resource Language="de-DE" />
</Resources>
but it changed nothing.
Thank's for you help.
Upvotes: 0
Views: 803
Reputation: 15296
Check this, it is what you want
Application resources and localization sample (Windows 8)
Upvotes: 1
Reputation: 137108
You will need to recreate the views that you've already displayed - which is what happens when you close and restart the application.
If you start the application and change the language, new views will be displayed in the new language, but any views that still exist in memory will show the original text.
You have two options:
Upvotes: 0