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

Intercultural communication
Intercultural communication Intercultural communication
Intercultural communication Boutkhil Guemide
 
Translation and Interpretation
Translation and InterpretationTranslation and Interpretation
Translation and Interpretationwendo1513
 
Language Change Part 3: UK Studies
Language Change Part 3: UK StudiesLanguage Change Part 3: UK Studies
Language Change Part 3: UK Studiessuasenglish
 
Discourse analysis
Discourse analysisDiscourse analysis
Discourse analysisAlvy Mayrina
 
Cross-Cultural Communication
Cross-Cultural CommunicationCross-Cultural Communication
Cross-Cultural CommunicationSherin Thomas
 
Communicating across cultures
Communicating across culturesCommunicating across cultures
Communicating across culturesJaydevVadachhak
 
Sociolinguistic variation and education
Sociolinguistic variation and educationSociolinguistic variation and education
Sociolinguistic variation and educationTayeb Rabahi
 
Computer mediated communication
Computer mediated communicationComputer mediated communication
Computer mediated communicationBoutkhil Guemide
 
Chapter 12 intercultural communication
Chapter 12   intercultural communicationChapter 12   intercultural communication
Chapter 12 intercultural communicationxiaoshandanni
 
Introduction to sociolinguistics
Introduction to sociolinguisticsIntroduction to sociolinguistics
Introduction to sociolinguisticsLusya Liann
 
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...OdalisVega1
 
Intercultural Communication by Claire Kramsch
Intercultural Communication by Claire KramschIntercultural Communication by Claire Kramsch
Intercultural Communication by Claire KramschParth Bhatt
 
Cross culture communication (1)
Cross culture communication (1)Cross culture communication (1)
Cross culture communication (1)kiruthika mohanraj
 
Cross Cultural Communication
Cross Cultural CommunicationCross Cultural Communication
Cross Cultural CommunicationSaranya vasudevan
 

What's hot (20)

Intercultural communication
Intercultural communication Intercultural communication
Intercultural communication
 
Culture & Communication
Culture & CommunicationCulture & Communication
Culture & Communication
 
Translation and Interpretation
Translation and InterpretationTranslation and Interpretation
Translation and Interpretation
 
Language Change Part 3: UK Studies
Language Change Part 3: UK StudiesLanguage Change Part 3: UK Studies
Language Change Part 3: UK Studies
 
Language Planning and Policy
Language Planning and PolicyLanguage Planning and Policy
Language Planning and Policy
 
Discourse analysis
Discourse analysisDiscourse analysis
Discourse analysis
 
Cross-Cultural Communication
Cross-Cultural CommunicationCross-Cultural Communication
Cross-Cultural Communication
 
Communicating across cultures
Communicating across culturesCommunicating across cultures
Communicating across cultures
 
Communication Across Cultures
Communication Across CulturesCommunication Across Cultures
Communication Across Cultures
 
Sociolinguistic variation and education
Sociolinguistic variation and educationSociolinguistic variation and education
Sociolinguistic variation and education
 
Computer mediated communication
Computer mediated communicationComputer mediated communication
Computer mediated communication
 
Cross Cultural Communication in Business
Cross Cultural Communication in BusinessCross Cultural Communication in Business
Cross Cultural Communication in Business
 
International Communication
International CommunicationInternational Communication
International Communication
 
Chapter 12 intercultural communication
Chapter 12   intercultural communicationChapter 12   intercultural communication
Chapter 12 intercultural communication
 
Introduction to sociolinguistics
Introduction to sociolinguisticsIntroduction to sociolinguistics
Introduction to sociolinguistics
 
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...
Ethnolinguistic vitality/ ANGUAGE POLICY AND LANGUAGE PLANNING IN MULTILINGUA...
 
Intercultural Communication by Claire Kramsch
Intercultural Communication by Claire KramschIntercultural Communication by Claire Kramsch
Intercultural Communication by Claire Kramsch
 
International Communication ppt
International Communication pptInternational Communication ppt
International Communication ppt
 
Cross culture communication (1)
Cross culture communication (1)Cross culture communication (1)
Cross culture communication (1)
 
Cross Cultural Communication
Cross Cultural CommunicationCross Cultural Communication
Cross Cultural Communication
 

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 globalization in c#
Localization and globalization in c#Localization and globalization in c#
Localization and globalization in c#PaYal Umraliya
 
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 (10)

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 globalization in c#
Localization and globalization in c#Localization and globalization in c#
Localization and globalization in c#
 
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

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
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
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
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
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
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
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
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
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

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.