我想使用 .resx 文件本地化 .Net Core 应用程序。谁能给我一个完整的分步解决方案?我是 WPF 和 .Net-Core 的新手。当我改变代码中的当前文化时,什么也没有发生。这是我的代码:
<ToolBar>
<Button Content="{x:Static strings:Resource.NewCustomer}" Command="{Binding NewCustomerDelegateCommand}"/>
</ToolBar>
Run Code Online (Sandbox Code Playgroud)
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE");
base.OnStartup(e);
}
}
Run Code Online (Sandbox Code Playgroud)