Change the language on the card controller on Windows Phone 8

When I change the phone language to any language (for example, French), the marks on the map change to French.

Is it possible to force a language into "Map Management"? I tried to use the "Language" property on the map and change it to "fr" and "fr-FR". He did not work.

+6
source share
3 answers

it's actually quite simple

if you want to change the global language:

private void Application_Launching(object sender, LaunchingEventArgs e) { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR"); Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR"); } private void Application_Activated(object sender, ActivatedEventArgs e) { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR"); Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR"); } 

if you want to get a single resource:

 CultureInfo c = new System.Globalization.CultureInfo("fr-FR"); var m = AppResources.ResourceManager.GetString(AppResources.MapControlTitle,c)); 

where AppResourse is your resource (resx) and AppResources.MapControlTitle is the label you want to get.

happy coding (:

EDIT

You can try the following:

Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo ("FR-FR"); YourMapControl.Language = System.Windows.Markup.XmlLanguage.GetLanguage (Thread.CurrentThread.CurrentCulture.Name);

+3
source

You can try with the current theme culture.

Try reinitializing the culture.

 System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-CH"); // For French Language ( or "fr-FR" ) 

before initializing card management.

In theory, The Thread will be reinitialized with French culture. ^^

+1
source

This is probably not the answer you were hoping for, but Map Control will always respect the operating system locale settings.

+1
source

Source: https://habr.com/ru/post/944600/


All Articles