简体   繁体   English

本地化基于LOCBaml或Resx的本地化的最佳方法是什么?

[英]What is the best way of localization LOCBaml or Resx based localization?

I came through this What is the best way to localize a WPF application, sans LocBAML? 我经历过了,没有LocBAML,什么是本地化WPF应用程序的最佳方法? . But, this didn't answer what I'm looking for. 但是,这并不能满足我的需求。

I'm creating a CustomControl in WPF. 我在WPF中创建一个CustomControl。 I would like to provide localization support. 我想提供本地化支持。 The control contains, images, strings etc., 该控件包含,图像,字符串等,

Any help would be greatly appreciated. 任何帮助将不胜感激。

Thanks 谢谢

I think the document linked in this post contains a lot of information about localization in WPF. 我认为这篇文章中链接的文档包含许多有关WPF本地化的信息。 In the end, it is up to you to decide which mechanism to use. 最后,由您决定使用哪种机制。

Since you are talking about a custom control, I would consider to give it a Culture dependency property which the consumer of your control can use to specify the desired culture. 由于您在谈论自定义控件,因此我考虑为它提供Culture依赖项属性,控件的使用者可以使用该属性来指定所需的文化。 This way, the consumer can use your localized control, relatively independent of the localization strategy he/she chose. 这样,消费者可以相对独立于他/她选择的本地化策略来使用您的本地化控件。

I'd suggest using Resx, try integrating into a WPF application with the TranslationByMarkupExtension example. 我建议使用Resx,尝试通过TranslationByMarkupExtension示例将其集成到WPF应用程序中。 http://www.wpftutorial.net/LocalizeMarkupExtension.html http://www.wpftutorial.net/LocalizeMarkupExtension.html

LocBaml was a very odd thing for Microsoft to put out there and isn't better, or even complete. LocBaml对于Microsoft推出市场来说是一件很奇怪的事情,它并不更好,甚至不完整。

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

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