多语种WPF应用程序 [英] multilingual wpf application

查看:132
本文介绍了多语种WPF应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序(英文),我想,让用户选择不同的语言。我看过一些可能改变在运行的应用程序的语言,但我只希望选择在安装时语言,永远不会改变它。

I have a WPF application (in English) and I would like to let users to select different languages. I have read some possibilities to change languages in runtime applications, but I only want to choose a language during installation time and never change it.

你觉得这样做是开发不同版本的程序(只改变文本的语言),并让用户选择他们的安装过程中的一个最快,最简单的方法?大概重复code只改变文本框或标签,是不是很优雅,但是请注意,我用英文完成的应用程序,我不需要改变的语言在运行时。

Do you think the fastest and easiest way to do it is developing different versions of the program (changing only text language) and let the user to select one of them during the installation?? Probably to repeat code only changing textbox or labels is not very elegant, but notice that I have the application finished in English and I don´t need to change language at runtime.

谢谢!

推荐答案

我想提出Aghilas解决好;但你可以在步骤3中使用 DynamicResource 的StaticResource 而不是使用 DynamicResource 不需要你的情况,你是不会同时应用程序运行于chnage的语言。

I think the solution proposed by Aghilas is good; but you can use StaticResource instead of using DynamicResource in step 3, DynamicResource is not required in your case as you are not going to chnage the language while application is running.

另外看看这些文章有关于在WPF使用的Resx文件进行本地化的详细信息 -

Also have a look at these articles having details about using Resx files for localization in WPF -

<一个href="http://geekswithblogs.net/robp/archive/2008/04/03/localizing-a-wpf-application-with-resx-files.aspx"相对=nofollow>本地化WPF应用程序使用的ResX文件

WPF本地化

WPF本地化指导 - 白皮书

这篇关于多语种WPF应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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