ASP.NET:显性隐性VS本土化? [英] ASP.NET: explicit vs implicit localization?
问题描述
在我的脑海里明确的定位隐含定位的优点是,如果你有一个以上的属性来定位对于一个给定的控制,这是一个更经济的语法。
在,你只需要本地化一些文字我用ASP的情况:呈现给用户界面本地化控制,只有单个属性(文本)。有没有理由使用了另一种?任何风格preference?是否有任何速度的差异?
隐
< ASP:本地化ID =Localize1=服务器元:=的ResourceKey东西/>
VS
明确
< ASP:本地化ID =Localize1=服务器文本=<%$资源:事情%GT; />
我同意了明确多了,有时你需要连接code /德code你有什么本地化。此外,多语言和文化的关系时,使用明确的为您节省头痛。
To my mind the advantage of implicit localization over explicit localization is that if you have more than one property to localize for a given control, it's a more economical syntax.
In the case where you just need to localize some text I use the asp:Localize control which only has a single property (Text) that renders to the UI. Is there a reason to use one over the other? Any style preference? Are there any speed differences?
Implicit
<asp:Localize ID="Localize1" runat="server" meta:resourcekey="Something" />
vs
Explicit
<asp:Localize ID="Localize1" runat="server" Text="<%$ Resources:Something %>" />
I'm more in favor over Explicit, sometimes you need to encode/decode what you have localized. Also, when dealing with multiple languages and culture, using Explicit saves you headaches..
这篇关于ASP.NET:显性隐性VS本土化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!