其他语言加载资源 [英] Load Resources for other Language

查看:166
本文介绍了其他语言加载资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它与资源工作进行翻译。这是伟大的工作。
现在,我有一个特殊的要求。对于这一点,我必须加载资源DLL另一种语言(例如,应用程序启动并用英文作品,那么我也必须加载德译本),并看看它的翻译。

I have an application, which works with Resources for translation. This is working great. Now, I have a special requirement. For this, I have to load the resource-dll for another language (for example, the application starts and works with English, then I have to also to load the German-translations) and look into it for a translation.

有一个容易的方法来做到这一点?

Is there an easy-way to do this?

推荐答案

您需要加载ResourceManager中并且如果需要的资源为特定的语言,你需要使用特定的文化要求对他们来说,使用:

You need to load the resourcemanager and If you need the resources for an specific language you will need to ask for them using the specific culture, using:

GetObject(String, CultureInfo)

您可以创建你需要使用的文化:

You can create the culture that you need using:

new CultureInfo(string name)

CultureInfo.CreateSpecificCulture(string name)

CultureInfo.GetCultureInfo(string name)

的名称是区域性名称:恩英语,德德......你可以看到一个完整的名单如下链接:文化

The name is the culture name: "en" English, "de" German... You can see a full list on the following link: cultures

这篇关于其他语言加载资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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