Culture information : Culture Format : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » Culture Format »

 

Culture information









    
using  System;
using  System.Collections;
using  System.Collections.Generic;
using  System.IO;
using  System.Reflection;
using  System.Resources;
using  System.Text;
using  System.Threading;
using  System.Globalization;

public  class  MainClass
{
        public  static  void  Main()
        {
              string[]  cultures  =  new  string[]  {  "en-US",  "en-GB",  "es-MX",  "de-DE",  "ja-JP"  };

                using  (TextWriter  sw  =  Console.Out)
                {
                        foreach  (string  c  in  cultures)
                        {
                                CultureInfo  ci  =  new  CultureInfo(c);
                                sw.Write("        Calendars:  ");
                                sw.Write("            {0}  (primary)",  ci.Calendar.GetType().Name);
                                foreach  (Calendar  cal  in  ci.OptionalCalendars)
                                        sw.Write(",  {0}",  cal.GetType().Name);
                                sw.WriteLine();

                        }
                }
        }
}
    
   
  
   



Output

Calendars:       GregorianCalendar (primary), GregorianCalendar, GregorianCalendar
    Calendars:       GregorianCalendar (primary), GregorianCalendar, GregorianCalendar
    Calendars:       GregorianCalendar (primary), GregorianCalendar
    Calendars:       GregorianCalendar (primary), GregorianCalendar
    Calendars:       GregorianCalendar (primary), GregorianCalendar, JapaneseCalendar, GregorianCale
ndar


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» Culture Format