Is there a best-practice approach for internationalization of an application?

点点圈 提交于 2019-12-10 04:10:14

问题


We need to have our apps be translated into other languages. This entails renaming the .text properties of our visible controls as well as other literals found within our apps to whatever language we need to translate into.

Is this something that can easily be accomplished with .resx files? I was thinking of creating a master resx key/value list where the key would be the fully qualified name of the control/variable/constant etc. and then refactor our apps to look into this file to get their values based on the cultureinfo found at runtime?

Is there a standard or simpler approach to this problem?


回答1:


There a quite a few resources for this:

MSDN guide for ASP.NET applications.
Code Project example for WPF applications.

You are correct in thinking that this can be achieved through the use of .resx files. Basically you create .resx file for each language you wish to support and if you give it a name based on the locale (EN-US, DE-DE, etc) then it gets picked up automatically.




回答2:


Check out FairlyLocal when you get a chance. It's a library that lets you do i18n using GetText, thus allowing you to follow the best practices from the rest of the industry rather than the .resx stuff that MS tries to force on you.



来源:https://stackoverflow.com/questions/2588127/is-there-a-best-practice-approach-for-internationalization-of-an-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!