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 %>" />
User
  • 49,320
  • 65
  • 164
  • 234
  • 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." – eran otzap Aug 10 '11 at 06:39
  • 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. – eran otzap Aug 10 '11 at 06:45

2 Answers2

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

HoBa
  • 3,035
  • 5
  • 23
  • 29
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.

Guru Kara
  • 5,636
  • 2
  • 35
  • 46