|
07.13.07
Localizing ASP.NET (Which Is Best?)
By
Mads Kristensen
There are different approaches to localizing an ASP.NET application. You can use a global resource file or local ones.
The local resource files only applies to a single page or user control, whereas the global can be used from anywhere.
I've always used the global resource file located in the App_GlobalResources folder.
I like that I can use all the text strings wherever I want.
However, I have never used a local resource file for a specific page or user control for that very same reason.
Lately though, I've thought that the local resource file might be good for some specific scenarios.
For instance if I know that a particular string is only going to be used on one specific page, then I don't clutter the global resource file with page specific strings.
| Learn How We Increased Conversion By 816% and Become A Certified Online Testing Professional™ Click Here |
|
However, then the information is spread over multiple files instead of just the global ones.
It reminds me about HTML style attributes and stylesheets.
Is it ok to hardcode styles directly onto a page if the same style is not being implemented anywhere else?
In my opinion yes, sometimes it makes sense, but I'm generally against it just like I've been against using local resource files.
Do you use local resources and if so, why have you chosen that instead of a global file?
Comments
About the Author: Mads Kristensen currently works as a Senior Developer at Traceworks located
in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in
2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and
web services in his daily work as well. A true .NET developer with great passion for the simple solution.
http://www.madskristensen.dk/
|