如何为项目自动生成resx文件
我想为我的项目自动生成 Resx 文件,我听说有一个程序可以做到这一点。 谁能告诉我它的名字吗?
I want to generation automatically Resx files for my project, I've heared that there's program which does it.
Can anyone tell me it's name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我唯一知道的程序是 Visual Studio。您可以使用 ResXResourceWriter 类轻松创建自己的程序。
The only program I know is Visual Studio. You can easily create your own program by using the ResXResourceWriter class.
正如 Hans 所说,对于表单和用户控件等组件,您可以通过“可本地化”属性来完成此操作。对于其他“.resx”文件,您可以轻松创建自己的本地化“.resx”文件,但需要正确命名(您可以阅读此内容 - 对于初学者来说,Google 提供“卫星程序集”)。然而,如果您的目标是处理一般翻译,那么除非您的应用程序非常小,否则这种方法很困难、乏味且容易出错(例如,尝试自行跟踪更改的字符串,其现有翻译已过时)。不过,有一些第三方软件包可以帮助您,我是其中一个软件包的作者(为了充分披露)。请参阅 http://www.hexadigm.com。
As Hans stated, for components such as forms and user controls, you can do this via the "Localizable" property. For other ".resx" files, you can easily create your own localized ".resx" file but it needs to be properly named (you can read up on this - Google for "satellite assemblies" for starters). If your goal is dealing with translations in general however, then unless your app is very small, this approach is difficult, tedious and error-prone (trying to track changed strings on your own for instance, whose existing translations have become obsolete). There are 3rd-party packages that can help you however, and I'm the author of one of them (in the interest of full disclosure). See http://www.hexadigm.com.