asp.net 国际化_上午1:05进行国际化/全球化和ASP.NET头脑风暴

asp.net 国际化

asp.net 国际化

I presented at ASPLive! and TechEd 2003 on Internationalizing ($g(i18n)) ASP.NET.  I know that the story changes with Whidbey and changes dramatically post-Whidbey, but until then...what are the best practices for ASP.NET 1.1?   DasBlog is a good example, as is (IMHO) the code I showed at the conferences.  Each takes certain approaches for performance vs. ease of i18n vs. avoiding $g(code smell).

我在ASPLive上展示过! 和TechEd 2003关于ASP.NET国际化($ g(i18n))。 我知道故事随着Whidbey的变化而变化,而在Whhidbey之后发生了巨大的变化,但是在那之前……ASP.NET 1.1的最佳实践是什么? DasBlog是一个很好的例子,就像(IMHO)我在会议上展示的代码一样。 每种方法都采取了某些方法来提高性能,同时简化i18n ,避免使用$ g(代码气味)

Some random thoughts, some questions, some rethorical, some I could use comments/thoughts on:

一些随机的想法,一些问题,一些理论性的问题,一些我可以在以下方面使用的评论/想法:

  • Store a single ResourceMananger in the Application Object and either yank and cast as needed or stick it in some base blass.  [Seems reasonable.  Preferable over instantiating on each page?]

    将单个ResourceMananger存储在应用程序对象中,然后根据需要拉动和投射,或将其粘贴在一些基本内容中。 [似乎合理。 比在每个页面上实例化更可取?]
  • Create a base class (LocalizedPage, etc) that introduces an "OnLocalize" method and event, and performance most of your i18n there. [Good, but usually only an 80% solution.  Does let you bypass localization for the default language, though, and that's a BIG performance gain.]

    创建一个基类(LocalizedPage等),该基类引入“ OnLocalize”方法和事件,并在此处提高大多数i18n的性能。 [很好,但通常只有80%的解决方案。 不过,是否可以让您绕过默认语言的本地化,这会带来很大的性能提升。]
  • For DataGrids, piggyback on DataBinding and do your i18n here [Not bad, easy, tends to spread i18n code out]

    对于DataGrids,搭载DataBinding并在此处执行您的i18n [不错,很容易,往往会散布i18n代码]
  • Localize in the .aspx page with <%#resMan.getString("someresourcename")> [Good, avoid cluttering code behind, also allows for quick changes without recompiles, although forces localization in the default language]

    使用<%#resMan.getString(“ someresourcename”)>在.aspx页面中进行本地化[很好,避免了混乱的代码,也允许快速更改而无需重新编译,尽管会强制使用默认语言进行本地化]

This and other questions burn...time to refactor...Now this looks like an interesting tool that makes ASP.NET localization more like WinForms localization.  I'll check out the trial, but I suspect it will break down when faced with complex ASP.NET DataGrids (definitely non-trivial to localize).

这个问题和其他问题很累...需要时间重构...现在看来是一个有趣的工具,它使ASP.NET本地化更像WinForms本地化。 我将检查该试用版,但是我怀疑当遇到复杂的ASP.NET DataGrids(对本地化绝对不容易)时,它会崩溃。

翻译自: https://www.hanselman.com/blog/internationalizationglobalization-and-aspnet-brainstorming-at-105am

asp.net 国际化

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值