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.
From the Home screen, swipe up and then tap Settings > Language & keyboard. Tap Languages.
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);
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. ^^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With