使用 Baml 管理本地化
我正在 WPF 中开发一个小应用程序,我想本地化我的资源。 我一直使用资源文件 (.resx),但我听说 BAML 应该会改变 WPF 应用程序中管理本地化的方式。
我进行了研究,找到了一种使用这些文件翻译我的应用程序的方法。
我写了一篇博客文章来展示我是如何通过这里做到这一点的(仅限法语,抱歉)。您可以在文章末尾查看英文链接的参考文献。
事实上,我真的不喜欢这种管理资源的方式。我认为这要复杂得多,而且我看不出使用这种方法的优点。
我是否错了或者我误解了 BAML 的某些内容?
谢谢。
I'm developping a little application in WPF and I want to localize my resources.
I've always used resources files (.resx), but I heard about BAML that was suppose to change the way of manage localization in a WPF application.
I made my research and I found a way to translate my application using those files.
I wrote a blog post to show how I did it over here (french only, sorry). You can see references at the end of the post for english links.
The fact is, I really dislike this way of managing resources. I think it's way more complicated and I don't see the pros of using this method.
Am I wrong or did I misunderstand something about BAML ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您已经很好地掌握了这个概念,是的,它太复杂了。
BAML 只是编译后的 XAML。您正在使用外部工具来提取资源、进行更改并将资源嵌入回来。它绝对没有简化,希望这个过程将来会变得更容易。
即使在流程文档上,您也会注意到底部有人建议使用 .resx 而不是这个过程。如果这已经是您用于本地化的方法,那么您可能不会发现采用 LocBaml 路线有多大优势。
I think you've got a fairly good grasp on the concept, and yes, it is too complicated.
BAML is just compiled XAML. You're using an external tool to extract the resource, make changes, and embed your resources back. It's definately not streamlined, and hopefully this process is made easier in the future.
Even on the documentation of the process, you'll notice at the bottom someone has recommended using .resx instead of this process. If this is already a method you're using for localization, you probably won't find much advantage in taking the LocBaml route.