SlideShare a Scribd company logo
1 of 24
Introduction
 Globalization is about internationalizing applications:
  the application supports number and date formats
  depending on the culture.
 Localization is about translating applications for
  specific cultures.
Globalization (Internationalization)
     Its is a process of creating an application that
      supports localized user interfaces.


Localization = translation
    It is the process of translating the applications
      into different languages.
 If you plan on distributing your application to an
  international audience, there are a number of things you'll
  need to keep in mind during the design and development
  phases. Even if you don't have such plans, a small effort up
  front can make things considerably easier should your
  plans change in future versions of your application.
  Services built into the .NET Framework make it easy to
  develop a single application that can adapt to different
  locales using managed development with Visual Basic or
  Visual C#.
 Visual Studio .NET was designed from the start to make
  developing for an international audience easy by taking
  advantage of services built into the .NET Framework. The
  following topics will help introduce you to the
  internationalization features built into Visual Studio .NET.
One Code Base
Cultures and Regions
 The world is divided into multiple cultures and regions, and applications have to be
aware of these cultural and regional differences. A culture is a set of preferences based
on a user’s language and cultural habits.
 Some examples are en-AU, en-CA, en-GB, and en-US for the English language in
   Australia,
 Canada, United Kingdom, and the United States.


 While one region has multiple languages, one language can be spoken in different
  regions; for example, Spanish is spoken in Mexico, Spain, Guatemala, Argentina, and
  Peru, to name but a few.
 The most important class in the System.Globalization
  namespace is the class CultureInfo.

 CultureInfo represents a culture and defines calendars,
  formatting of numbers and dates, and sorting strings that
  are used with the culture.

 The class RegionInfo represents regional settings (such
  as the currency) and shows if the region is using the
  metric system. In the same region, you can use multiple
  languages.
 One example is the region of Spain with its Basque (eu-
  ES), Catalan (ca-ES), Spanish (es-ES), Galician (gl-ES)
  cultures.
Types of Culture
  Invarient
  Neutral
  Specific
Invariant Culture
 Should be used for storing data in a culture
  independent way
 Should not be used for User Interface elements
 Has no country/region

Eg:
CultureInfo ci = CultureInfo.InvariantCulture
Neutral Culture
 Associated with a language not with country/region
 Can be used for UI related options
 Cannot be used for retrieving information such as
  date/time formatting
 Specified using <languagecode2> format:
   Arabic – “ar”
   Exceptions – zh-CHT, zh-CH
Eg.
using System.Globalization;
…
CultureInfo ci = new CultureInfo(“fr”);
Specific Culture
 Associated with Language and a Country/Region
    fr  Neutral Culture
    fr-FR  Specific Culture
 Provides additional information about the date, time,
  currency and number formatting options
 Can be used wherever a Neutral culture is used, the
  opposite is not true

Eg.
using System.Globalization;
…
CultureInfo ci = new CultureInfo(“fr-FR”);
Formatting and Parsing
 Formatting
    Standard formatting characters
    Custom formatting characters
 Parsing
    Configurable with styles
    TryParse – no conversion exceptions
    ParseExact for date/time values

                          Formatting
                                           Culture-appropriate
   Type Object             Parsing                String
Numeric Formats



•   Store as binary data type if possible
    •   Integer, decimal, floating-point
•   Invariant storage as text
    •   Format using CultureInfo.InvariantCulture
    •   Use standard format character “R” (reversible) for floating point
        numbers
Currencies
decimal dec = decimal.Parse("$1000000.23",
NumberStyles.Currency,CultureInfo.CurrentCulture);
System.Console.WriteLine("{0:C}", dec);

Output: $1,000,000.23


 Preferably store as decimal with meta data
    Culture
    DateTime
 Use 3rd party service
                      for conversion
 When storing as text use invariant culture
    Reversible text floating-point format
    Currency text format: ¤1,000,000.23
System.Globalization
Namespace
   Includes classes for functionality such as:
       Culture-aware string comparison
           Coté vs. Côte             (culture dependent)
       Date & Time formatting
           yy/mm/dd vs. dd/mm/yy
       Numeric formatting
           12,000.00 vs. 12.000,00
       Calendars
           Gregorian and non-Gregorian
CultureInfo class
  provides culture specific information
  Controls date comparisonstring comparison number
   comparison etc

 CultureInfo userculture=Thread.CurrentThread.CurrentCulture
 (Used for calculation and Internal Manipulation)
 CultureInfo userculture=Thread.CurrentThread.CurrentUICulture
 (Used for DisplayPurpose)
CurrentCulture Thread
       Date and number formatting
       String comparison and casing
       It determines the results of culture dependant functions.
       You can define the CurrentCulture object with specific
        cultures and not with neutral cultures.
CurrentUICulture Thread
       It determines which resources are loaded by the Resource
        Manager if you have provided resources in multiple
        languages.
        Because this controls only which language is used you can
         define CurrentUICulture with either neutral or specific
         cultures.
Changing the Culture
programmatically

CultureInfo ci = new CultureInfo(culture);
 // set culture for formatting
Thread.CurrentThread.CurrentCulture = ci;
// set culture for resources
Thread.CurrentThread.CurrentUICulture = ci;
Implementing localization
 When the Localizable property is set to true, the
  resource file resX is generated form the form.
  BookOfTheDay.resX
 change the Language property of the form and the
  properties of some form elements, a new resource file
  is generated for the specified language.
  BookOfTheDayForm.de.resX
Culture-aware Classes
   Any API which takes a culture, or an
    IFormatProvider
   Culture-sensitive by default
   Examples:
       System.Globalization.CompareInfo
       System.Globalization.StringInfo
       System.Globalization.Calendar
       System.Resources
       System.DateTime
       System.String
 Calendar Classes
   Includes support for:
      Gregorian Calendar

      Hebrew Calendar

      Hijiri Calendar

      Japanese Calendar

      Julian Calendar

      Korean Calendar

      Taiwan Calendar

      Thai Buddhist Calendar

   Base Calendar class from which custom calendars can be
    derived
 DateTime
   Provides methods that enable culture-sensitive
    operations on a DateTime.
   Use the DateTimeFormatInfo Class to format and
    display a DateTime based on culture.
 DateTimeFormatInfo
   Defines how DateTime values are formatted and
    displayed, depending on the culture.
 CompareInfo
    Provides a set of methods that can be used to perfomr
     culture-sensitive string comparisons
    The CultureInfo class has a CompareInfo property that is
     an instance of the CompareInfo class
    The String.Compare method uses the information in the
     CultureInfo.CompareInfo property to compare strings
 NumberFormatInfo
    Defines how currency, decimal separator and other
     numeric symbols are formatted and displayed based on
     culture.

More Related Content

What's hot

Linguistic approach to translation theory
Linguistic approach to translation theoryLinguistic approach to translation theory
Linguistic approach to translation theoryAbdullah Saleem
 
Language, Power, Identity & Global Politics
Language, Power, Identity & Global PoliticsLanguage, Power, Identity & Global Politics
Language, Power, Identity & Global PoliticsRabbiaAzam
 
Functional theories
Functional theoriesFunctional theories
Functional theoriesLy Berns
 
Language and Politics
 Language and Politics Language and Politics
Language and PoliticsDr Shamim Ali
 
Cross Cultural Conflict and Adjustment
Cross Cultural Conflict and AdjustmentCross Cultural Conflict and Adjustment
Cross Cultural Conflict and AdjustmentElviyasa Siregar
 
Language, culture and thought
Language, culture and thoughtLanguage, culture and thought
Language, culture and thoughtZubair A. Bajwa
 
Intercultural communication in Education/ classroom
Intercultural communication in Education/ classroomIntercultural communication in Education/ classroom
Intercultural communication in Education/ classroomenyscha
 
Ambiguities in nlp
Ambiguities in nlpAmbiguities in nlp
Ambiguities in nlpRaza Azeem
 
Intercultural Business Communication Ppp
Intercultural Business Communication PppIntercultural Business Communication Ppp
Intercultural Business Communication Pppsanliap72
 
Cultural Awareness in Business
Cultural Awareness in BusinessCultural Awareness in Business
Cultural Awareness in BusinessJohan van Hamme
 
Relationship between language, culture, and identity
Relationship between language, culture, and identityRelationship between language, culture, and identity
Relationship between language, culture, and identityCool Chaandni
 
#language contact and language choice
#language contact and language choice #language contact and language choice
#language contact and language choice Ayman Batool
 
Linguistic inequality ppt
Linguistic inequality pptLinguistic inequality ppt
Linguistic inequality pptzhian fadhil
 

What's hot (20)

Linguistic approach to translation theory
Linguistic approach to translation theoryLinguistic approach to translation theory
Linguistic approach to translation theory
 
Language, Power, Identity & Global Politics
Language, Power, Identity & Global PoliticsLanguage, Power, Identity & Global Politics
Language, Power, Identity & Global Politics
 
Functional theories
Functional theoriesFunctional theories
Functional theories
 
Purposes(skopos theory)
Purposes(skopos theory)Purposes(skopos theory)
Purposes(skopos theory)
 
Consumer culture
Consumer culture Consumer culture
Consumer culture
 
Does society affect language?
Does society affect language?Does society affect language?
Does society affect language?
 
Language and Politics
 Language and Politics Language and Politics
Language and Politics
 
LANGUAGE AND IDENTITY
LANGUAGE AND IDENTITYLANGUAGE AND IDENTITY
LANGUAGE AND IDENTITY
 
Cross Cultural Conflict and Adjustment
Cross Cultural Conflict and AdjustmentCross Cultural Conflict and Adjustment
Cross Cultural Conflict and Adjustment
 
Language, culture and thought
Language, culture and thoughtLanguage, culture and thought
Language, culture and thought
 
Intercultural communication in Education/ classroom
Intercultural communication in Education/ classroomIntercultural communication in Education/ classroom
Intercultural communication in Education/ classroom
 
Ambiguities in nlp
Ambiguities in nlpAmbiguities in nlp
Ambiguities in nlp
 
Borrowing
BorrowingBorrowing
Borrowing
 
Intercultural Business Communication Ppp
Intercultural Business Communication PppIntercultural Business Communication Ppp
Intercultural Business Communication Ppp
 
Code Switching
Code SwitchingCode Switching
Code Switching
 
Cultural Awareness in Business
Cultural Awareness in BusinessCultural Awareness in Business
Cultural Awareness in Business
 
Language and ethnic group
Language and ethnic groupLanguage and ethnic group
Language and ethnic group
 
Relationship between language, culture, and identity
Relationship between language, culture, and identityRelationship between language, culture, and identity
Relationship between language, culture, and identity
 
#language contact and language choice
#language contact and language choice #language contact and language choice
#language contact and language choice
 
Linguistic inequality ppt
Linguistic inequality pptLinguistic inequality ppt
Linguistic inequality ppt
 

Viewers also liked

Translation, Localization And Globalization Zhu Xianchao
Translation, Localization And Globalization Zhu XianchaoTranslation, Localization And Globalization Zhu Xianchao
Translation, Localization And Globalization Zhu Xianchaozhuxianchao
 
Localization Project Management
Localization Project ManagementLocalization Project Management
Localization Project ManagementMaria Asnes
 
Localization in WSN
Localization in WSNLocalization in WSN
Localization in WSNYara Ali
 
Localization And Branding
Localization And BrandingLocalization And Branding
Localization And BrandingChris Raulf
 
Localization Project Management
Localization Project ManagementLocalization Project Management
Localization Project Managementbarakdanin
 
Localization and contextualization_04162014
Localization and contextualization_04162014Localization and contextualization_04162014
Localization and contextualization_04162014Dods Dodong
 
Localization & contextualization
Localization & contextualizationLocalization & contextualization
Localization & contextualizationLdPFerndz Bee
 
Localization of MI on ECG
Localization of MI on ECGLocalization of MI on ECG
Localization of MI on ECGNooh Khushal
 

Viewers also liked (9)

Translation, Localization And Globalization Zhu Xianchao
Translation, Localization And Globalization Zhu XianchaoTranslation, Localization And Globalization Zhu Xianchao
Translation, Localization And Globalization Zhu Xianchao
 
Localization Project Management
Localization Project ManagementLocalization Project Management
Localization Project Management
 
Localization in WSN
Localization in WSNLocalization in WSN
Localization in WSN
 
Localization And Branding
Localization And BrandingLocalization And Branding
Localization And Branding
 
Localization Project Management
Localization Project ManagementLocalization Project Management
Localization Project Management
 
Localization framework
Localization frameworkLocalization framework
Localization framework
 
Localization and contextualization_04162014
Localization and contextualization_04162014Localization and contextualization_04162014
Localization and contextualization_04162014
 
Localization & contextualization
Localization & contextualizationLocalization & contextualization
Localization & contextualization
 
Localization of MI on ECG
Localization of MI on ECGLocalization of MI on ECG
Localization of MI on ECG
 

Similar to C#: Globalization and localization

Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationRishi Kothari
 
Glis Localization Internationalization 05 20071030
Glis Localization Internationalization 05 20071030Glis Localization Internationalization 05 20071030
Glis Localization Internationalization 05 20071030Jan Pawlowski
 
Localization and Shared Preferences in android
Localization and Shared Preferences in androidLocalization and Shared Preferences in android
Localization and Shared Preferences in androidAly Arman
 
Software Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic ConceptsSoftware Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic Conceptsguest1f8175
 
plone.app.multilingual
plone.app.multilingual plone.app.multilingual
plone.app.multilingual Ramon Navarro
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issuesSURBHI SAROHA
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibilityaspnet123
 
Designing a multilingual knowledge graph - DCMI2018
Designing a multilingual knowledge graph - DCMI2018Designing a multilingual knowledge graph - DCMI2018
Designing a multilingual knowledge graph - DCMI2018Antoine Isaac
 
Putting Historical Data in Context: how to use DSpace-GLAM
Putting Historical Data in Context: how to use DSpace-GLAMPutting Historical Data in Context: how to use DSpace-GLAM
Putting Historical Data in Context: how to use DSpace-GLAM4Science
 
Webinar slides: Interoperability between resources involved in TDM at the lev...
Webinar slides: Interoperability between resources involved in TDM at the lev...Webinar slides: Interoperability between resources involved in TDM at the lev...
Webinar slides: Interoperability between resources involved in TDM at the lev...openminted_eu
 
Networked Digital Library Of Theses And Dissertations
Networked Digital Library Of Theses And DissertationsNetworked Digital Library Of Theses And Dissertations
Networked Digital Library Of Theses And Dissertationssinglish
 
Ms Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean ExtensionsMs Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean Extensionsjason hu 金良胡
 
Python for Everybody - Solution Challenge 2021
Python for Everybody - Solution Challenge 2021Python for Everybody - Solution Challenge 2021
Python for Everybody - Solution Challenge 2021AshwinRaj57
 
Exploring comparative evaluation of semantic enrichment tools for cultural he...
Exploring comparative evaluation of semantic enrichment tools for cultural he...Exploring comparative evaluation of semantic enrichment tools for cultural he...
Exploring comparative evaluation of semantic enrichment tools for cultural he...Hugo Manguinhas
 

Similar to C#: Globalization and localization (20)

Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform Internationalization
 
Glis Localization Internationalization 05 20071030
Glis Localization Internationalization 05 20071030Glis Localization Internationalization 05 20071030
Glis Localization Internationalization 05 20071030
 
2005 09 Dc Keynote
2005 09 Dc Keynote2005 09 Dc Keynote
2005 09 Dc Keynote
 
Internationalization
InternationalizationInternationalization
Internationalization
 
Localization and Shared Preferences in android
Localization and Shared Preferences in androidLocalization and Shared Preferences in android
Localization and Shared Preferences in android
 
Data types
Data typesData types
Data types
 
Software Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic ConceptsSoftware Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic Concepts
 
Aos ciard-china
Aos ciard-chinaAos ciard-china
Aos ciard-china
 
plone.app.multilingual
plone.app.multilingual plone.app.multilingual
plone.app.multilingual
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issues
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibility
 
Designing a multilingual knowledge graph - DCMI2018
Designing a multilingual knowledge graph - DCMI2018Designing a multilingual knowledge graph - DCMI2018
Designing a multilingual knowledge graph - DCMI2018
 
Lemon at-mlw3
Lemon at-mlw3Lemon at-mlw3
Lemon at-mlw3
 
Putting Historical Data in Context: how to use DSpace-GLAM
Putting Historical Data in Context: how to use DSpace-GLAMPutting Historical Data in Context: how to use DSpace-GLAM
Putting Historical Data in Context: how to use DSpace-GLAM
 
Webinar slides: Interoperability between resources involved in TDM at the lev...
Webinar slides: Interoperability between resources involved in TDM at the lev...Webinar slides: Interoperability between resources involved in TDM at the lev...
Webinar slides: Interoperability between resources involved in TDM at the lev...
 
Networked Digital Library Of Theses And Dissertations
Networked Digital Library Of Theses And DissertationsNetworked Digital Library Of Theses And Dissertations
Networked Digital Library Of Theses And Dissertations
 
Ms Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean ExtensionsMs Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean Extensions
 
DS.pptx
DS.pptxDS.pptx
DS.pptx
 
Python for Everybody - Solution Challenge 2021
Python for Everybody - Solution Challenge 2021Python for Everybody - Solution Challenge 2021
Python for Everybody - Solution Challenge 2021
 
Exploring comparative evaluation of semantic enrichment tools for cultural he...
Exploring comparative evaluation of semantic enrichment tools for cultural he...Exploring comparative evaluation of semantic enrichment tools for cultural he...
Exploring comparative evaluation of semantic enrichment tools for cultural he...
 

Recently uploaded

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Recently uploaded (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

C#: Globalization and localization

  • 1.
  • 2. Introduction  Globalization is about internationalizing applications: the application supports number and date formats depending on the culture.  Localization is about translating applications for specific cultures.
  • 3. Globalization (Internationalization)  Its is a process of creating an application that supports localized user interfaces. Localization = translation  It is the process of translating the applications into different languages.
  • 4.  If you plan on distributing your application to an international audience, there are a number of things you'll need to keep in mind during the design and development phases. Even if you don't have such plans, a small effort up front can make things considerably easier should your plans change in future versions of your application. Services built into the .NET Framework make it easy to develop a single application that can adapt to different locales using managed development with Visual Basic or Visual C#.  Visual Studio .NET was designed from the start to make developing for an international audience easy by taking advantage of services built into the .NET Framework. The following topics will help introduce you to the internationalization features built into Visual Studio .NET.
  • 6. Cultures and Regions  The world is divided into multiple cultures and regions, and applications have to be aware of these cultural and regional differences. A culture is a set of preferences based on a user’s language and cultural habits.  Some examples are en-AU, en-CA, en-GB, and en-US for the English language in Australia,  Canada, United Kingdom, and the United States.  While one region has multiple languages, one language can be spoken in different regions; for example, Spanish is spoken in Mexico, Spain, Guatemala, Argentina, and Peru, to name but a few.
  • 7.  The most important class in the System.Globalization namespace is the class CultureInfo.  CultureInfo represents a culture and defines calendars, formatting of numbers and dates, and sorting strings that are used with the culture.  The class RegionInfo represents regional settings (such as the currency) and shows if the region is using the metric system. In the same region, you can use multiple languages.  One example is the region of Spain with its Basque (eu- ES), Catalan (ca-ES), Spanish (es-ES), Galician (gl-ES) cultures.
  • 8. Types of Culture  Invarient  Neutral  Specific
  • 9. Invariant Culture  Should be used for storing data in a culture independent way  Should not be used for User Interface elements  Has no country/region Eg: CultureInfo ci = CultureInfo.InvariantCulture
  • 10. Neutral Culture  Associated with a language not with country/region  Can be used for UI related options  Cannot be used for retrieving information such as date/time formatting  Specified using <languagecode2> format:  Arabic – “ar”  Exceptions – zh-CHT, zh-CH Eg. using System.Globalization; … CultureInfo ci = new CultureInfo(“fr”);
  • 11. Specific Culture  Associated with Language and a Country/Region  fr  Neutral Culture  fr-FR  Specific Culture  Provides additional information about the date, time, currency and number formatting options  Can be used wherever a Neutral culture is used, the opposite is not true Eg. using System.Globalization; … CultureInfo ci = new CultureInfo(“fr-FR”);
  • 12. Formatting and Parsing  Formatting  Standard formatting characters  Custom formatting characters  Parsing  Configurable with styles  TryParse – no conversion exceptions  ParseExact for date/time values Formatting Culture-appropriate Type Object Parsing String
  • 13. Numeric Formats • Store as binary data type if possible • Integer, decimal, floating-point • Invariant storage as text • Format using CultureInfo.InvariantCulture • Use standard format character “R” (reversible) for floating point numbers
  • 14. Currencies decimal dec = decimal.Parse("$1000000.23", NumberStyles.Currency,CultureInfo.CurrentCulture); System.Console.WriteLine("{0:C}", dec); Output: $1,000,000.23  Preferably store as decimal with meta data  Culture  DateTime  Use 3rd party service for conversion  When storing as text use invariant culture  Reversible text floating-point format  Currency text format: ¤1,000,000.23
  • 15. System.Globalization Namespace  Includes classes for functionality such as:  Culture-aware string comparison  Coté vs. Côte (culture dependent)  Date & Time formatting  yy/mm/dd vs. dd/mm/yy  Numeric formatting  12,000.00 vs. 12.000,00  Calendars  Gregorian and non-Gregorian
  • 16. CultureInfo class  provides culture specific information  Controls date comparisonstring comparison number comparison etc CultureInfo userculture=Thread.CurrentThread.CurrentCulture (Used for calculation and Internal Manipulation) CultureInfo userculture=Thread.CurrentThread.CurrentUICulture (Used for DisplayPurpose)
  • 17. CurrentCulture Thread  Date and number formatting  String comparison and casing  It determines the results of culture dependant functions.  You can define the CurrentCulture object with specific cultures and not with neutral cultures.
  • 18. CurrentUICulture Thread  It determines which resources are loaded by the Resource Manager if you have provided resources in multiple languages.  Because this controls only which language is used you can define CurrentUICulture with either neutral or specific cultures.
  • 19. Changing the Culture programmatically CultureInfo ci = new CultureInfo(culture); // set culture for formatting Thread.CurrentThread.CurrentCulture = ci; // set culture for resources Thread.CurrentThread.CurrentUICulture = ci;
  • 20. Implementing localization  When the Localizable property is set to true, the resource file resX is generated form the form. BookOfTheDay.resX  change the Language property of the form and the properties of some form elements, a new resource file is generated for the specified language. BookOfTheDayForm.de.resX
  • 21. Culture-aware Classes  Any API which takes a culture, or an IFormatProvider  Culture-sensitive by default  Examples:  System.Globalization.CompareInfo  System.Globalization.StringInfo  System.Globalization.Calendar  System.Resources  System.DateTime  System.String
  • 22.  Calendar Classes  Includes support for:  Gregorian Calendar  Hebrew Calendar  Hijiri Calendar  Japanese Calendar  Julian Calendar  Korean Calendar  Taiwan Calendar  Thai Buddhist Calendar  Base Calendar class from which custom calendars can be derived
  • 23.  DateTime  Provides methods that enable culture-sensitive operations on a DateTime.  Use the DateTimeFormatInfo Class to format and display a DateTime based on culture.  DateTimeFormatInfo  Defines how DateTime values are formatted and displayed, depending on the culture.
  • 24.  CompareInfo  Provides a set of methods that can be used to perfomr culture-sensitive string comparisons  The CultureInfo class has a CompareInfo property that is an instance of the CompareInfo class  The String.Compare method uses the information in the CultureInfo.CompareInfo property to compare strings  NumberFormatInfo  Defines how currency, decimal separator and other numeric symbols are formatted and displayed based on culture.