Globalization and Localization

Globalization refers to formatting data in formats relevant for the current culture setting. Globalization is the process of designing and developing applications that function for multiple cultures.
example:
a) Consider this tag in Web.Config file.
           
    It would cause the dates to be displayed in French for the web page of
    the folder where this Web.Config file is located.
b) CultureInfo d=new CultureInfo("de-DE");
    Response.Write(DateTime.Now.ToString("D",d);
    It would display date in long format using German culture
------------------------------------------------------------------------------------------------------------
Localization is the process of customizing your application for a given culture and local. Localization refers to retrieving and displaying appropriately localized data based on the culture.
It can be done by using the Resource files.
example:
we have 2 resource files:
a)default.aspx.fr-FR.resx
b)default.aspx.en-US.resx



Resource Files
A resource file is an XML file that contains the strings that you want to translate into different languages or paths to images.
The resource file contains key/value pairs. Each pair is an individual resource. Key names are not case sensitive.
e.g. A resource file might contain a resource with the key Button1 and the value Submit

Resource files in ASP. NET have an .resx extension. At run time, the .resx file is compiled into an assembly.


Global Resource Files
You create a global resource file by putting it in the reserved folder App_GlobalResources at the root of the application.

Any .resx file that is in the App_GlobalResources folder has global scope.


Local Resource Files
A local resources file is one that applies to only one ASP. NET page or user control (an ASP. NET file that has a file-name extension of .aspx, .ascx, or .master).

No comments:

Post a Comment