|#268596 Author: chandramohan Member Level: Gold Member Rank: 0 Date: 23/Jul/2008 Rating: Points: 1|
What is the difference between globalization and localization ?
Globalization is the process of making a product multi-lingual. All language-related aspects of the program are separated from the code, and all aspects, which vary with target country, are handled in a country-independent way.
Localization is the process of adapting a global product for a particular language and country. Localization includes translations and other conversion, and takes into account local practices and culture, providing a product, which is comfortable to use in the target country.
Translation is involved in most aspects of localization. Accuracy and appropriateness of translation are key to overall product quality.
Retrofitting is an informal term for localization of a product, which was not designed to be global. It is the first step taken by most companies entering the global marketplace
Applications must be designed to accommodate users from various cultures. Users in different parts of the world use different languages and different formatting standards for numbers, currency, and dates. International applications should be customizable according to the preferences of users belonging to different nations, cultures, or regions. An application uses the locale to identify the preference of a user. The local is the combination of a language and a country. For example, the locale of a user speaking English and belonging to the United States is "en-US". The locale includes information about the formats used for representing time and date, symbols and conventions used for representing currency, and the character encoding scheme being used.
The structure of an internationalized application is divided into two blocks:
Code Block: Contains the application code or the executable part of an application. This block will remain the same for all locales.
Data Block: Contains all the resources, such as text and images used by the user interface (UI). This block is locale-specific, and each locale will have one data block.
The process of making an application ready for customers is called internationalization. It includes three phases:
Globalization: Involves writing the executable code for an application in such a way that makes it culture-neutral and language-neutral. While incorporating globalization, you must ensure that the culture-specific details are not hard-coded into the executable code. The primary task in this phase is to identify the various locale-sensitive resources and to isolate these resources from the executable code.
Localizability: An application that has been globalized must be tested to ensure that its executable code is independent of the culture and language-specific data. This is called localizability testing. The focus of localizability testing is to check how the application adapts itself to different locales.
Localization: Involves the customization of an application for a specific locale. One major task in this phase is the translation of resources identified during the globalization phase. During this phase, various resources, such as images and text, for the designated locale are created.
When designing an international application, you should ensure the following factors:
User Interface (UI): The language used to design different UI components, such as menu, message box, static-text holder (label), is not fixed during design phase of the application.
Information Formats: The formats of different elements, such as currency, number, and date, are not fixed during design phase of the application.
The different aspects of an application that should be taken into account while incorporating localization are:
Formats: The formats used for displaying numbers, time, dates and currency should be considered while incorporating localization.
Graphics: The locale-sensitive graphics, such as maps, traffic signs, and calendar should be considered while incorporating localization.
The System.Globalization namespace provides different classes that enable you to determine locale-specific information, such as te language and country of an application at run time. The System.Globalization namespace includes classes that enable you to localize your application. For example, the Calendar class contains different calendars, such as JulianCalendar and GrgorianCalendar.
Using the CultureInfo Class
Every locale is identified by a culture. The general format of the culture is as follows:
<Language code>-<Country/Region code>
Language code: Represents a two-letter representation of a language. It is always written in lowercase. For example, the language code for Arabic is "ar" and that for Russian is "ru".
Country/Region code: Represents a two-letter representation of a country or a region. It is always written in uppercase. For example, the country code for Russia is "RU" and that for France is "FR".
Cultures are of two types:
Neutral culture: Signifies a culture that is linked only to a language and not to a country. For example, "ru" is a neutral code.
Specific culture: Signifies a culture that is linked to both a country and a language. For example, "ru-RU" is a specific code.
The following table describes some of the commonly used properties of the CultureInfo class:
Returns an instance of the CultureInfo class that represents the culture for the current thread
Returns an instance of CultureInfo class that represents the culture for culture-specific resources.
Returns the name of the culture in format: <Language code>-<country/region code>
Returns the English name of the culture in f<Language code>-<country/region code> format
Returns the name of the culture in <Language code>-<country/region code> format
Returns the culture identifier for the instance of the CultureInfo class. Every culture has an identifier. For e.g., 0x0407 is the identifier for "de-DE" culture
The following table describes some of the commonly used methods of the CultureInfo class:
Returns a list of supported cultures.
Returns an object that represents the format of a specified type. For e.g., this method will return an object representing the format of the date when the specified type is date/time.
The following code snippet shows how to use the CultureInfo class:
CultureInfo my_CI = new CultureInfo ("ru-RU");
In the preceding code snippet, a new CultureInfo class instance by the name, my_CI, is created that sets the culture of the instance to "ru-RU".
Working with Resources
A resource is any non-executable data that is logically deployed with an application. A resource might be displayed in an application as an error message or as a part of the UI. Examples of resources include the strings displayed in the UI based on the culture settings of the system or a set of images. A separate resource file should be created for each culture for which the application is to be customized. Information is stored in a resource file in the key/value format. For example, to store the welcome message you must assign a the message to a key. Like this:
WelcomeText = "Welcome to my homepage";
In the preceding code snippet, WelcomeText is the key and "Welcome to my homepage" is the value. There are specific naming conventions to follow when naming resource files. The resource file for default culture should be Strings.txt or Strings.ResX, and for any other culture Strings.culture-name.ResX. Where Strings represents the name of the file. For e.g., Strings.fr-CA.resx. After resource files are created in the text form, they need to be converted into a binary format recognized by the .NET Framework.
Generating Resource File
You can use the Resource File Generator (ResGen.exe) command prompt utility to convert a resource file in the text format into the binary format. The syntax is as follows:
resgen [/compile] [inputfilename.extension] [outputfilename.extension]
The extension of the input filename will be .resource.
Creating Resource-Only Assemblies
To create a resource-only assembly, perform the following steps:
Create a new Visual C# project with the Empty Project template.
From the Project menu, select the Add Existing Item option to add the resources files to the project.
In Solution Explorer, right-click your project and select the Properties option. The property page opens.
In the Output Type drop-down menu, change the output type of your project to class Library. This will cause your assembly to be compiled as a .dll file.
Build you application.
The output will be a DLL file, which will contain all the resource files you added.
Creating Satellite Assemblies
Satellite assemblies are resource-only assemblies that contain only culture-specific resources. The name of the resources included in a satellite assembly should follow this naming convention:
The name of a resource file included within a satellite assembly should reflect the culture to which it belongs. All applications will contain one culture-neutral main assembly, which will be loaded by default when a request is sent to the application. The relationship between the main assembly and the satellite assembly under the Windows platform follows a hub-and-spoke model. When a Web application is deployed, the main assembly is always copied in the bin folder in the application root. Satellite assemblies are copied into the subfolders beneath the bin folder in the application root. Satellite assemblies are copied into the subfolders beneath the bin folder based on their culture. For example, the satellite assembly for the culture, fr, will be copied into the bin\fr folder and that for the culture, fr-CA, will be copied into the bin\fr\CA folder.
Perform the following steps to create a satellite assembly:
Open the Web application to which you need to add resource files.
From the project menu, select the Add existing Item option to add the resource files to your application. Resource files should be named according to the naming conventions.
From the Build menu, select the Build solution option to build your solution.
Culture-specific resource files are automatically compiled into satellite assemblies and placed in an appropriate directory structure.
The difference between resource-only and satellite assemblies is that resource-only assemblies can contain any resource, such as images and text. Satellite assemblies contain only culture-specific resources.
You can also use the AL.exe utility to link resource files to your application. The AL (Assembly Linker) is a command prompt utility shipped with the standard version of Visual Studio .NET.
Retrieving Resources at Run Time
The System.Resources namespace provides different classes, which enable you to retrieve values from resource files. This namespace contains the ResourceManager class which manages all the resources associated with an application.
It can be used to retrieve resources from an assembly. Each instance of the ResourceManager class is associated with an assembly that contains the resources. This class provides different constructors that can be used according to the need. For example, when you need to retrieve resources from an assembly, use the ResourceManager constructor, which has the following syntax:
ResourceManager ( "BaseName" , "Assembly Name", Type)
In the preceding syntax:
BaseName: Represents the root name of the resource.
Assembly Name: Represents the name of the assembly, which contains the resource.
Type: Represents the ResourceSet, which is the set of resources for a specific culture. The resources associated with each culture have a ResourceSet associated with them.
If the resources are stored in a folder instead of an assembly, you can use the FileBasedResourceManager function of the ResourceManager class. This function takes the following three parameters:
BaseName: Represents the root of the resource
ResourceDir: Represents the folder in which the resource is to be searched.
Type: Represents the ResourceSet.
The other important classes in the System.Resources namespace are:
ResourceWriter: Used to write into a resource file.
ResourceReader: Used to read form a resource file.
Configuring a Web application for Globalization
In ASP.NET, you can use the Web.config file to configure an application for globalization. The <globalization> tag enables you to configure locale-specific information, such as culture and encoding. The <globalization> tag has the following attributes:
requestEncoding: Allows you to specify the assumed encoding of incoming requests. The default value of this attribute is utf-8.
responseEncoding: Allows you to specify the encoding used for the response data. The default value is utf-8.
fileEncoding: Allows you to specify the way in which the .aspx, .asmx, .asax files are encoded in a Web application. The default value is utf-8.
culture: Allows you to specify the culture.
uiCulture: Allows you to specify the UI culture.
The following code snippet shows an example of how to use the <globalization> tag to configure a Web application:
Here we will be creating an ASP.NET application that is locale-aware. For simplicity sake we our only creating it for 2 cultures, although its just the repetition of steps that would be required if you wish to implement using more cultures.
Our application will have an user interface with a drop down list from where the user can select the culture of his choice and then the Text values of the controls would be as per the selected culture.
Perform the following steps for the same:
Create a new Web application and I have named it "globalization" as per this example.
Change the name of the Webform1.aspx to culture.aspx.
Design the culture form. Drag two label controls, a dropdownlist and a button.
Create two resource Files. For this right-click the project file and select the Add->New folder. Rename this folder as Resources.
Now add new items to this project, select resource assembly file from the template pane. Rename it as strings.resx.
In the name column write "msg" and in the value column write "Welcome to my homepage", in this strings.resx file. Save this file and close it.
Drag this file to the "Resources" folder from the solution explorer.
Similarly add another .resx file, remember to use the culture convention of renaming it. We will be renaming it for France culture so, the it would be renamed as "strings.fr-FR.resx".
Now we need to generate strings.Resources file and strings.fr-FR.resources file.For this go to the command prompt of Visual Studio .NET (go to start->all programs->Microsoft Visual Studio .net 2003->Visual Studio .net tools->Microsoft Visual Studio .net command prompt)
Type the following command there: resgen strings.resx
Note you will need to navigate to the "Resources" folder using " cd " command of DOS, since you have this .resx file in Resources folder.
Do this for all your .resx files and their respective .resources files would be generated, as shown in the figure below:
creating a website to global use is acalled as globalization...creating a website restricted to particular language of region is called a localization...
eg is if i create a web site in which i can select any language to view and it is understandable is called globalized 1....if i create that particular site only in one language and that region time ...like that is called as localization....
main considerations are like language,time,currency.....
Sometimes our application may need to cater content in different languages for different country users. Let us see in this article how to cater different contents based on the culture using Globalization in ASP.NET.
Globalization is the process of designing and developing a software product that function for multiple cultures. A web forms page have two culture values ,Culture and UICulture. Culture is used to determine culture dependent function such as Date, Currency. So it is used for date formatting ,number formatting. UICulture values is used to determine which language the resources should load that is which UIstring the resource should use. The two culture settings do not need to have same values. It may be different depending on the application.
Setting Culture and UICulture
1. Through Web.Config
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="fr-FR"/>
2. In Code-inline (aspx) Page
<%@ Page UICulture="fr" Culture="en-US" ....%>
3. In Code-Behind (aspx.cs) Page
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture ("fr-FR");
ASP.NET wont automatically translate the contents in one language to another language by using Culture. For this we need to put strings in resources file and have to load the strings based on the culture. Let us see how to create resources and use.
Resources represents embedded data such as strings or images, which can be retrieved during runtime and displayed in the user interface. Resource Management is a feature of .NET framework which is used to extract localized element from source code and to store them with a string key as resources . At runtime, ResourceManager class instance is used to resolve key to the original resource or localized version. Resources can be stored as an independent file or part of an assembly.
ResourceWriter and resgen.exe can be used to create .resources file. To include .resources file inside an assembly use related compiler switch or Al.exe.
Create Resource Text Files:
Test = Hello there, friend!
Test = Bonjour lÃ , ami!
Generate .resources file:
Goto VisualStudio.Net command prompt and use resgen command utility to generate .resources file
This commands will create .resources file.
In TestGlobalization.aspx Page,
<asp:RadioButtonList id="RadioButtonList1" style="Z-INDEX: 101; LEFT:144px; POSITION: absolute; TOP: 144px" runat="server" AutoPostBack="True">
<asp:ListItem Value="en-US" Selected="True">English</asp:ListItem>
In TestGlobalization.aspx.cs Page,on Page_Load Event
CultureInfo objCI = new CultureInfo ( RadioButtonList1 .SelectedValue .ToString ()) ;
Thread.CurrentThread.CurrentCulture = objCI;
Thread.CurrentThread.CurrentUICulture = objCI;
ResourceManager rm = ResourceManager .CreateFileBasedResourceManager ("resource", Server.MapPath("resources") + Path.DirectorySeparatorChar, null);
This will output the content based on the option selected. Hope this article would have helped you all
|#268624 Author: Ultimaterengan Member Level: Gold Member Rank: 9 Date: 23/Jul/2008 Rating: Points: 1|
Globalization is the process of designing and developing applications that function for multiple cultures, and localization is the process of customizing your application for a given culture and locale. The topics in this section describe how to create ASP.NET Web applications that can be adapted to different languages and cultures."
I believe intrnationalization is the same thing as globalization, the 2 terms are synonyms at least in terms of ASP.NET development
Thanks & Regards
Nothing is mine ,Everything is yours!!!
|#268986 Author: Ashok Khanna Member Level: Gold Member Rank: 0 Date: 23/Jul/2008 Rating: Points: 1|
Localization means "process of translating resources for a specific culture", and
Globalization means "process of designing applications that can adapt to different cultures".
Before one thinks about making any Globalize App, he/she should plan the app.
Always think about the 2 aspects: -
1. Proper Globalization: - Your Application should be able to Accept, Verify, and Display All global kind of data; It should well also be able to operate over this Data, accordingly. We will discuss more about this "Accordingly operations over diff. culture data".
2. Localizability and Localization: - Localizability stands for clearly separating the components of culture based Operations regarding the user interface, and other operations from the executable code.
refer : http://www.c-sharpcorner.com/UploadFile/brijrajsingh/glbal_110012005021049AM/glbal_1.aspx?ArticleID=21ff2915-e619-4009-8162-ff9e54a0c02c
Please rate this post, if it is useful for you.
Thanks & Regards
|#268987 Author: Ashok Khanna Member Level: Gold Member Rank: 0 Date: 23/Jul/2008 Rating: Points: 1|
The .NET Framework provides support for globalization and localization. Localization is the customisation of data and resources for specific 'locales' or languages. Whereas in pre-Internet days it wasn't unusual for an application to be designed for use in a single country, now an Internet application can be accessed by users from anywhere in the world.
A locale categorises a collection of data and rules specific to a language and geographical area. These include information on sorting rules, date and time formatting, numeric and monetary conventions and symbols and character encoding. Thus you can see localization isn't simply about language and translating the text of the user interface.
ASP.NET uses Unicode which makes our life easier. The use of Unicode with culture encodings allows us to tailor response data. The pertinent namespaces for Localization are System.Globalization and System.Threading.
Dealing with Globalization
When writing an application for multiple locations around the world you could write completely different sets of source code for each location. That wouldn't be a very efficient approach however, with much overlap between each application. More sensibly you would write one set of source code and build into the solution the ability to customise the application for different locations. This is achieved in VB.NET via techniques such as locale-aware formatting functions and resource files.
Microsoft divides the process of preparing a 'world ready application' into three phases:
1. Globalization - is the identification of all the localizable resources in the application and separating them from the executable code so that they can be modified easily.
2. Localizability - is checking whether the changes needed for a given location will require design changes to the application.
3. Localization - is the actual customisation of the application for the designated locales consisting primarily of translating resources that you identified during the globalization phase.
refer : http://www.dotnetjohn.com/articles.aspx?articleid=59
Please rate this post, if it is useful for you.
Thanks & Regards
|#268989 Author: Ashok Khanna Member Level: Gold Member Rank: 0 Date: 23/Jul/2008 Rating: Points: 1|
Understanding Globalization: Globalization is process of identifying all the localizable resources in the application, that will support multiple cultures. Ideally it is perform during design phase of an application, so that the resources always remains separate from the code.
Understanding Localization: In Localization you customize the application for new locales. This consist of translating resources that you identified during the globalization phase.
Difference between Localization and Globalization: Globalization is process of identifying how many resources needs to be localized to adopt a multiple culture support, while Localization is actual process of translating resource to a specific culture.
refer : http://dotnetguts.blogspot.com/2006/11/understanding-globalization-and.html
Please rate this post, if it is useful for you.
Thanks & Regards
|#268991 Author: Ashok Khanna Member Level: Gold Member Rank: 0 Date: 23/Jul/2008 Rating: Points: 1|
In globalization the process of internationalization enables you to remove from the code base and the presentation layer all the contents and make you to use only a single presentation layer and single code base with a common contents that can suit any culture. The internationalization process will aid you to keep all the contents in a common place with an idea of making it easily accessible by the programme codes and the results can easily be populated all over presentation layer and the application with ease and efficiently.
In addition to the above, the internationalization process also enables you to store the contents and all the collected inputs from the user in a user friendly format and in a highly secured manner without compromising any standards pertaining to the local culture. The internationalization process is one step before any attempt for localising the application to suit to the local needs.
With the help of the localization process of globalization, you can make your application adaptable to the various location specific conditions and it will be easy for you to translate and re-format your application to suit to your new location and that too without changing any of the codes. Further, you can make use of the process for rectifying any of the reported bugs and for fine tuning the application for running smoothly without any hitch.
Please rate this post, if it is useful for you.
Thanks & Regards