使用.resx文件为全球应用程序的消息? [英] Using .Resx files for global application messages?

查看:115
本文介绍了使用.resx文件为全球应用程序的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我用我的网站内的所有静态消息的全球资源文件。主要错误信息等。

So I'm using a Global Resource file for all static messages within my site. Mainly error messages etc..

他们并不需要进行本地化,但我觉得这只是将它们都存储在一个位置一个好主意。

They do not need to be localized, but I felt it was just a good idea to store them all in one location.

它会得到更好的使用只是所谓的SiteConstants什么的一个静态类?或者是使用RESX文件好吗?

Would it have been better to use just a static class called "SiteConstants" or something? Or is using a RESX file okay?

谢谢!

推荐答案

绝对使用的资源文件。

该.resx文件做引擎盖下你创建类。最重要的是,自动生成的code已经拥有所有的东西本土化照顾你。如果您决定本地化应用程序,但也将是这些东西自动支持,如果您使用prescribed文件/文件夹结构。且不说本地化您的应用程序将只是翻译上的问题,这是最好的情况下(没有提到像货币以外的本地化问题,这是一个整体独立的问题)。

The .resx files do create classes under the hood for you. Most importantly, though, the auto-generated code will already have all the localization stuff taken care of for you. If you decide to localize your application, there will also be automatic support for that stuff if you use the prescribed file/folder structure. Not to mention that localizing your app will merely be a matter of translation, which is the best-case scenario (not mentioning other localization issues like currency, which is a whole separate issue).

这篇关于使用.resx文件为全球应用程序的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆