简体   繁体   English

如何将默认语言resx复制到特定于语言的resx文件以能够生成资源DLL?

[英]How to copyng Default Language resx to a language specific resx file to be able to Generate resource DLL?

Is there a way to copy the default resx file (default language) to an actual satellite assembly but automatically? 有没有一种方法可以自动将默认的resx文件(默认语言)复制到实际的附属程序集?

It appears that default language RESX files are not output as a DLL, only language specific ones. 似乎默认语言RESX文件不会输出为DLL,而只会输出特定于语言的文件。

It appears i can FORCE to creation of a satellite dll by using resgen, but this would mean writing a POSTBUILD event with lots of calls to resgen, 看来我可以通过使用resgen强制创建附属dll,但这意味着编写带有大量对resgen的调用的POSTBUILD事件,

   resgen frmTest.resx MySatDLL.resources

Is there any other options. 还有其他选择吗?

Thanks in advance 提前致谢

You should be able to just copy the .resx file to a new file for the localized resources, using the properly formatted name. 您应该能够使用正确格式的名称将.resx文件复制到本地资源的新文件中。

For example, if you wanted to localize ftmTest.resx to Japanese, copy it to a file named ftmTest.ja.resx . 例如,如果要将ftmTest.resx本地化为日语,请将其复制到名为ftmTest.ja.resx的文件中。 Once you add this file to your project and do a build, Visual Studio should automatically create the satellite assembly for you. 一旦将此文件添加到项目中并进行构建,Visual Studio应自动为您创建附属程序集。

Note that for localizing forms, you should use the Form designer and change the language there, rather than copying its .resx file. 请注意,要本地化表单,应使用表单设计器并在其中更改语言,而不是复制其.resx文件。 I believe that once you set a form as localize-able it changes the generated designer code. 我相信,一旦将表单设置为可本地化,它将更改生成的设计器代码。 This approach would work if you have a .resx file of just strings, for example. 例如,如果您的.resx文件仅包含字符串,则此方法有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM