Visual Studio 2008中的本地化 [英] Localization in Visual Studio 2008

查看:58
本文介绍了Visual Studio 2008中的本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VS2008中本地化桌面应用程序(C#).

I am trying to localize a desktop app (C#) in VS2008.

我已经掌握了多种语言形式的本地化,并且我也有一个用于通用字符串的项目资源文件,但是我无法理解如何创建该文件的多种语言版本!

I have mastered localizing the forms for multiple languages and I also have a project resource file for general strings but I cannot fathom out how to create multiple language versions of this file!

似乎没有任何地方记录它.

It doesn't seem to be documented anywhere.

结果似乎是,如果我想生成应用程序的德语版本,则必须编辑常规资源文件(Properties/Resources.resx),构建并部署该应用程序,然后重新编辑该文件.常规资源文件改回英文.

The consequence seems to be that if I want to produce, say, a German version of my application I have to edit the general resource file (Properties/Resources.resx), build and deploy the application, then re-edit the general resource file back to English.

每次我想制作一个新的德语版本时,我都必须做同样的事情.与用于本地化表单的工具相比,这似乎笨拙,我相信VS2008中会有更好的方法.有人知道这是什么吗?

Every time I want to produce a new German version I would have to do the same. This seems so clunky compared to the tools for localising forms that I am sure there is a better way in VS2008. Does anyone know what it is?

推荐答案

您说对了,我看错了问题.

You're right, I misread the question.

在这种情况下,您可能想尝试的是在项目中添加新项,或者添加现有资源文件的现有副本,而可能只需要在VS外部首先重命名即可.

In that case what you might want to try is add a new Item to the your project, or you add an existing copy of your existing resource file just might have to rename it first outside VS.

选择资源文件"

将其命名为Resource.de-DE.resx

Name it Resource.de-DE.resx

创建后,您可以将其移动到属性"文件夹.

Once it it created you can move it the Properties folder.

打开文件,将顶部的访问修饰符更改为internal,它将设置为不生成代码"

Open the file, change the access modifier at the top to internal, it will be set to "No code generation"

将带有德语翻译的字符串添加到新的资源文件中

Add your strings with the German translations to the new resource file

编译时,如果语言或线程UI区域性发生变化,则应使用语言资源文件中的正确值.

Compile and when the language or thread UI culture changes it should use the correct values from the language resource file.

我的快速小测试工作正常,并根据需要进行了切换.

My quick little test worked fine and switched as desired.

这篇关于Visual Studio 2008中的本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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