Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the language on Map control on Windows Phone 8

When I change the language of the phone to any language (say French), the labels in the map change to French.

Is it possible to force a language in Map Control? I tried to use "Language" property of the Map and change it to "fr" & "fr-FR". It didnt work.

like image 776
Ateik Avatar asked May 09 '13 06:05

Ateik


People also ask

How do I change the language on my HTC Windows Phone?

From the Home screen, swipe up and then tap Settings > Language & keyboard. Tap Languages.


2 Answers

actually it's quite simple

if you wanna 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 wanna to get single resource:

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

where AppResourse is your resource (resx) file, and AppResources.MapControlTitle is the label that wanna get.

happy coding (:

EDIT

can you try this:

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

like image 51
Swift Sharp Avatar answered Oct 04 '22 00:10

Swift Sharp


You can try with the current Culture of the Thread.

Try to reinitialize the culture

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

before your Map Control Initialization.

In Theory, The Thread will be Reinitialized with the french Culture. ^^

like image 24
Doc Roms Avatar answered Oct 04 '22 01:10

Doc Roms