从Windows 10 UAP C#中的代码设置区域性语言>> [

问题描述 投票:0回答:1
我创建带有文件夹en,eu等的主文件夹“ Strings”。然后我创建资源文件并填充它。都怪。我可以从代码中更改应用程序语言吗?例如,将语言添加到comboBox,然后在组合框上单击后更改我的语言?

我创建带有文件夹en,eu等的主文件夹“ Strings”。然后创建资源文件并填充它。都怪。我可以从代码中更改应用程序语言吗?例如,将语言添加到comboBox,然后......>

c# localization windows-phone-8.1 resources windows-10
1个回答
1
投票
您可以为此使用CurrentCultureCurrentUICulture。在组合框中,您可以具有区域性或字符串列表,例如“ en-US”,“ nl-BE”等。

var culture = new CultureInfo("en-US"); // replace en-US with the selected culture or string from the combobox CultureInfo.CurrentCulture = culture; CultureInfo.CurrentUICulture = culture;

© www.soinside.com 2019 - 2024. All rights reserved.