Lets find out what is localization, globalization and internationalization in .NET and how it works. Will peep into the Application directory as well as Resource file usage.
2. Agenda
• Localization, Internationalization & Globalization
• .NET Package For You
• System.Globalization
• System.Globalization.CultureInfo
• Aplication Directory
• Fallback Mechanism of Resource
• Implementation
3. Localization, Internationalization & Globalization
• Localization
• Making your application support a specific language/locale.
• Internationalization
• Making your application able to support a range of languages and locales
• Globalization
• The combination of Internationalization and Localization
• Language & Locale
Language Locale
4. .NET Package For You
I/O Collections Security
Reflection Diagnostics Threading
Net Serialization ServiceProcess
Globalization Resources Text
• System.Globalization
Core Locale services (Date/Time, Currency, Language Processing etc.)
• System.Resource
Multi-Lingual Resource Services
• System.Text
Core character conversion Services. (To/From Unicode)
5. System.Globalization
• Culture-aware String Services
• Casing, Comparison, Collation, Segmentation, Enumeration etc.
• Date-Time Formatting
• dd/mm/yy, mm/dd/yyyy etc.
• Numeric Formatting
• 12,000,000 and 12.000.000
• Calendar Support
• Gregorian, non-gregorian
6. System.Globalization.CultureInfo
• Information about specific cultures i.e
<LanguageCode>-<RegionCode>
en-US es-ES fr-FR
CultureInfo
CurrentUICulture
CurrentCulture
CurrentUICulture : meant to cover the localization (a.k.a. localisation, a.k.a. translation) of Windows into
other languages.
CurrentCulture : allows a user to take any language version of Windows (even if it is not their native
language) and see defaults for date formats and number formats and order of text in sorted lists that make
sense to them.
8. Application Directory (Contd.)
Thread.CurrentThread.CurrentUICulture = new CultureInfo(“en-CA");
Application Directory
Root .NET Application
en
en-US
en-UK
en-CA
es-ES
ja
9. Resource Fallback Mechanism
Fallback mechanism used to locate appropriate
resources
•Attempt to load “en-CA” resource assemble
Resource Fallback Mechanism
•If not available, load “en” assembly
•If not available, load default application 3
Root .NET Application
resources
•Else raise an exception
en
2
en-US
en-UK
en-CA
1
ja
10. • Resources are defined in XML
documents Compilation Process
– RESX Files
• Filenames are significant
– Resource.en-US.resx
– Resource.en-UK.resx
– Resource.en-CA.resx .resx file
• Satellite Assemblies
– For each language variant
Resource.en-US.resx .resource file
Resource.en-CA.resx
.resource.dll file