Visual Studio 2017如何在设计的UI上切换文本语言 [英] Visual Studio 2017 how to switch the text language on the designed UI

查看:118
本文介绍了Visual Studio 2017如何在设计的UI上切换文本语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi

我正在设计带按钮,标签的WPF界面在用英语的UI上。

I am designing WPF interface with buttons, labels on the UI with English.

我想将按钮上的现有文本,UI上的标签转换为中文单词,有没有办法通过使用C#代码来实现在VS2017?

I want to convert the existing text on buttons, labels on the UI to Chinese words, is there a way to do this by using C# code in VS2017?

- KB

推荐答案

朋友,

如果我正确理解您的问题, WPF 全球化和本地化
可能是符合您要求的。

If I understand your question correctly, WPF globalization and localization might be what could meet your requirement.

要本地化WPF应用程序,您有几个选择。例如,您可以将应用程序中的
可本地化资源绑定到XML文件,将可本地化文本存储在resx表中,或让本地化程序使用可扩展应用程序标记语言
(XAML)文件。

To localize a WPF application, you have several options. For example, you can bind the localizable resources in your application to an XML file, store localizable text in resx tables, or have your localizer use Extensible Application Markup Language (XAML) files.

doc blew提供了具体信息和示例供您参考:

The doc blew gives the specific info and examples for you to refer:

https://docs.microsoft .com / zh-cn / dotnet / framework / wpf / advanced / wpf-globalization-and-localization-overview #localize-a-wpf-application

有人还分享了一个关于  WPF 本地化的解决方案的简单项目,这可能会有所帮助,以防您需要,所以链接在这里:

someone also shared a simple project about he solution of WPF localization, which might be helpful, just in case you want it, so the link is here:

https://www.codeproject.com/Articles/30035/Simple-WPF-本地化

致以最好的问候,

Fletcher


这篇关于Visual Studio 2017如何在设计的UI上切换文本语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆