Localization/Globalization
How can we use Culture Auto in project? `
Dec 7th
We will make a simple login screen which we will try to use for English as well as Greek.
Note: – I was thinking of using Hindi as the second language. But while writing this tutorial my Hindi culture settings was not properly installed so switched to Greek. Well I worked in Greece for 2 years it was a lovely country. This answer I dedicate to the wonderful days spent in Greece.
The login screen will display English settings when an English user logs in and Greek Settings when a Greek user logs in. So below are the steps to start with.
More >Can resource file be in any other format other than resx extensions?
Dec 7th
Yes they can be in .txt format in name and value pairs. For instance below is a simple .txt file with values.
lblUserId = User Id
lblPassword = Password
cmdSubmitPassword = Submit
What are resource files and how do we generate resource files?
Dec 7th
Resource files are files which contain program resources. Many programmers think resource files for only storing strings. But you can also store bitmaps, icons, fonts, wav files in to resource files.
In order to generate resource file you need click on tools – generate local resource as shown in the figure below. Do not forget to keep page in designer view or else you will not see the option. Once you generate the resource file you will see the resx file generated in the solution explorer.
Which are the important namespaces during localization and globalization?
Dec 7th
There are two most important namespaces:-
- System.Globalization – contains classes that define culture-related information,including the language, the country/region, the calendars in use, the format patterns for dates, currency and numbers, and the sort order for strings.
- System.Resources – provides classes and interfaces that allow developers to create, store, and manage various culture-specific resources used in an application. With this namespace you can read a resource file and display it accordingly to the user’s .
culture.
How do we get the current culture of the environment in windows and ASP.NET?
Dec 7th
“CultureInfo.CurrentCulture” displays the current culture of the environment. For instance if you are running Hindi it will display “hi-IN”. Please note one thing in mind “CurrentCulture” will only give you the culture on which your application is running. So if it’s a windows application this will work fine. But in ASP.NET 2.0 we need to know what culture the end user has.
For a real international website you different users can log in with different culture. For instance you can see from the given figure below different users are logging in with different regional settings. Client browser sends the information in the More >
What architecture decisions you should consider while planning for international software’s?
Dec 7th
- Avoid hard coding of strings in the project. Any display right from labels to error messages read it from a resource file.
- Length of the string is also of prime importance. It’s a noted fact that when wetranslate English language in to other language the words increase by minimum 30 to 40 %. For instance you can see from the below figure how the Hindi text has increased as compared to English text.
What’s the difference between localization and globalization?
Dec 7th
Below are the definition’s which is taken from the Microsoft glossary.
Globalization: It is the process of developing a program core whose features and code design are not solely based on a single language or locale.
Below are the definition’s which is taken from the Microsoft glossary.
Globalization: It is the process of developing a program core whose features and code design are not solely based on a single language or locale.
Does .NET support UNICODE and how do you know it supports?
Dec 7th
Yes .NET definitely supports UNICODE. Try to see sizeof (char), you will see 2 bytes. Char type data type stores only one character which needs only 8 bits but because .NET has to support UNICODE it uses 16 bits to store the same.
What is Unicode and why was it introduced?
Dec 7th
In order to understand the concept of Unicode we need to move little back and understand ANSI code. ASCII (ask key) stands for American Standard Code for Information Interchange. In ASCII format every character is represented by one byte (i.e. 8 bits). So in short we can have 256 characters (2^8). Before UNICODE came in to picture programmers used code page to represent characters in different languages. Code page is a different interpretation of ASCII set. Code pages keep 128 characters for English and the rest 128 characters are tailored for a specific language.
There are following disadvantages of the CODE More >
