18. Internationalization (I18N).pdf

18. Internationalization (I18N).pdf - JAVA Means DURGA SIR...

This preview shows page 1 - 4 out of 13 pages.

JAVA Means DURGA SIR 117 DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038,
Image of page 1

Subscribe to view the full document.

JAVA Means DURGA SIR 118 DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, Internationalization (I18N) Agenda 1. Introduction 2. Locale o How to create a Locale object o Important methods of Locale class 3. NumberFormat o Getting NumberFormat object for the default Locale o Getting NumberFormat object for the specific Locale o Requirements Write a program to display java number form into Italy specific form Write a program to print a java number in INDIA, UK, US and ITALY currency formats o Setting Maximum, Minimum, Fraction and Integer digits 4. DateFormat o Getting DateFormat object for default Locale o Getting DateFormat object for specific Locale o Requirements Write a program to represent current system date in all possible styles of us format Write a program to represent current system date in UK, US and ITALY styles o Getting DateFormat object to get both date and time Introduction
Image of page 2
JAVA Means DURGA SIR 119 DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, The process of designing a web application such that it supports various countries, various languages without performing any changes in the application is called Internationalization. If the request is coming from India then the response should be in India specific form , and if the request is from US then the response should be in US specific form. We can implement Internationalization by using the following classes. They are: 1. Locale 2. NumberFormat 3. DateFormat 1. Locale: A Locale object can be used to represent a geographic (country) location (or) language. Locale class present in java.util package. It is a final class and direct child class of Object and , implements Cloneable, and Serializable Interfaces. How to create a Locale object: We can create a Locale object by using the following constructors of Locale class. Locale l=new Locale(String language); Locale l=new Locale(String language,String country); Locale class already defines some predefined Locale constants. We can use these constants directly. Example: Locale. UK Locale. US Locale. ITALY Locale. CHINA
Image of page 3

Subscribe to view the full document.

JAVA Means DURGA SIR 120 DURGASOFT, # 202,2 nd Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038, 040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | Important methods of Locale class: 1. public static Locale getDefault() 2. public static void setDefault(Locale l) 3.
Image of page 4
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern