ASP.Net contains namespaces like System.Globalization,culture info class,Resoursemanager,resoursefiles to support multi lingual applications.
We store the content in xml files,resourse files(also xml),database.
We need to create base resourse file and language specific resourse files.
When the application is compiled, the resource files are embedded into assemblies ,the default resource file is embedded in the main assembly (.dll file), language specific resource files are embedded into their own assemblies called satellite assemblies. Resouse file looks like key(name)/value pairs ,the name is the same for all resource files, and the value is a language specific translation of same content.
The resource manager will automatically load the right resource file based on the current thread's CurrentCulture value .The ResourceManager class automatically retrieves the content from the right XML file based on the thread's CurrentCulture value .
Three functions we mainly use
-
The public method GetString which is used throughout the application to access the required resource
-
The private method GetResource which gets a Hashtable either from the cache or by calling LoadResource
-
The private method LoadResource which parses the XML file and stores it into the cache
No comments:
Post a Comment
Post your comments here: