ASP.NET: explicit vs implicit localization?
Asked Answered
P

2

6

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 %>" />
Plug answered 21/8, 2010 at 0:55 Comment(2)
i was just wondering the same thing .. according to msdn "Explicit localization is useful when you have large bodies of text or custom messages you want to localize, in addition to controls and labels. For example, you could develop a series of localized welcome and thank you messages for an e-commerce site, and use explicit declarative expressions to place this text on your pages. Additionally, explicit localization allows you to maintain a single set of localized resource files rather than maintaining a separate set of files for each page."Authorship
i don't quite get it yet.. but i think what their trying to say is that u can specify different values for the same control, what u can't do when using implicit localization.Authorship
I
1

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..

Impetuosity answered 5/10, 2011 at 1:12 Comment(0)
A
0

Well your question got me thinking if any of the two provides complie time error check. And found that it dose not provide compile time check. Both bombs at run time when given wrong values.

Activist answered 21/12, 2011 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.