在Windows Phone 8上更改Map控件上的语言

Ate*_*eik 6 map here-api windows-phone-8

当我将手机的语言更改为任何语言(例如法语)时,地图中的标签将更改为法语.

是否可以在Map Control中强制使用某种语言?我尝试使用Map的"Language"属性并将其更改为"fr"和"fr-FR".它没有用.

Swi*_*arp 3

其实很简单

如果你想改变全球语言:

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");          
        }
Run Code Online (Sandbox Code Playgroud)

如果你想获得单一资源:

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

您的资源 (resx) 文件在哪里AppResourse,以及AppResources.MapControlTitle,并且是想要获取的标签。

快乐编码(:

编辑

你能试试这个吗:

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