同一项目的两个设置(Visual Studio 2008,C#)
我有一个用 C# 编写的 Visual Studio 项目。
我想要针对不同的语言有两种不同的设置。例如,setup-en
表示步骤为英语,setup-es
表示西班牙语安装程序。
我希望根据设置构建项目。也就是说,如果我构建 setup-en
我希望它在我的项目中进行检查,并使用英语的用户界面和西班牙语的用户界面构建项目。
有什么办法可以管理这个吗?希望我说得足够清楚。
I have a Visual Studio project written in C#.
I want to have 2 different setups for different languages. For example, setup-en
for step to be in English and setup-es
for a Spanish installer.
I want the project to be built depending on the setup. Namely if I build setup-en
I want it to check for in my project and build the project with English language for the user interface and same for Spanish.
Is there any way to manage this? Hope I was clear enough.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在您的项目中进行启动时操作,如下所示:
此示例基于项目中包含的文件 Names.xml。创建一些语言文件夹并将 Names.xml 文件包含在这些文件夹中。
要进行设置,请使用 HM nis 编辑器,位于 http://hmne.sourceforge.net/。
运行此程序时,插入文件名 setup-EN 并选择所有 DLL 和 .EXE 文件。还包括英文 - Names.xml 文件夹/地图
我希望这对你有用
make a action-on-startup in your project, somethin like this:
this example is based on the file, Names.xml, which is included to the project. make some language folders and include the Names.xml file in these folders.
for making a setup, use HM nis editor, found at http://hmne.sourceforge.net/.
when running this program insert as filename setup-EN and choose all the DLL and .EXE files. Also include the English - Names.xml folder/map
i hope this will work for you
Visual Studio 安装项目不支持此功能。这只能通过支持为每种语言生成单独的包的安装创作工具来完成。
您可以在此处找到设置工具列表:
http://en.wikipedia.org/wiki/List_of_installation_software
提供本地化的大多是商业软件。本地化安装程序不是一个简单的功能,这就是它未包含在 Visual Studio 中的原因。
This is not supported by Visual Studio setup projects. It can be done only with a setup authoring tool which supports generating separate packages for each language.
You can find a list of setup tools here:
http://en.wikipedia.org/wiki/List_of_installation_software
The ones which offer localization are mostly commercial. Localized installers is not a simple feature, this is why it wasn't included in Visual Studio.
我认为您可以通过在 xml 文件中存储每种语言的标签名称、按钮文本等来做到这一点。当您选择语言时,将加载所选语言的值。
I think you can do this, by storing label names, button texts,... in xml files, for each languages. When you select the language the values with the selected language will be loaded.
我认为这不可能仅在设置中完成。
您可以将所有文本放入一个单独的文件中,并将英语版本添加到英语程序中,将西班牙语版本添加到西班牙语程序中。
然而,这不会影响按钮等(除非您让每个按钮都查看此文件)
我想我有两个版本的(视觉)代码和表单的最佳方式,并在显示之前检查选择的语言。但这是在实际程序中完成的,而不是在设置中完成的。
I don't think this will be possible to do only in the setup.
You can put all the text into a seperate file and add the english version to your english program and spanish to the spanish.
This however will not affect the buttons and such (unless you have every one of them look at this file)
The best way i guess i have the (visual) code and forms in 2 versions and check what language is selected before displaying. But this is done in the actual program not the setup.