Internationlization

595 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
595
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Internationlization

  1. 1. Internationalization
  2. 2. What is internationalization? the process of creating applications which can adapt and adjust tovarious countries, languages, regions. I18N
  3. 3. What is localization? the process of adapting an application for a specific language orcountry by addition of locale-specific components and translation of text. L10N
  4. 4. Why need internationalization?
  5. 5. Why need internationalization? Difference: - Language - Currency - Date and time
  6. 6. Alternatives to solve the Problem? Develop product Translate product
  7. 7. Benefits of I18N and L10N No hard coding No recompilation Localized quickly
  8. 8. Unicode provide a unique number for every character irrespective of platform, program or language. Unicode is a 16-bit character encoding
  9. 9. Significance of Unicode Java platform uses Unicode as its native character encoding. Uxxxx : X : hexadecimal digit
  10. 10. Internationalization Process
  11. 11. Properties file MessageBundle.properties MessageBundle_fr_FR.properties MessageBundle_de_DE.properties
  12. 12. Locale Constructors: public Locale(String language, String country) public Locale(String language) Locale usLocale = new Locale(“en”,”us”)
  13. 13. Methods public static Locale getDefault() public final String getDisplayCountry() public final String getDisplayLanguage()
  14. 14. Resource Bundle Localized or translated into different languages Handled for multiple locales at the same time Supported for more locales later
  15. 15. Using Resource Bundle ResourceBundle getBundle(String, Locale)
  16. 16. Fetching the text from Resource Bundle public final String getString(String key)
  17. 17. Fetching the text from Resource Bundle public abstract Enumeration <String> getKeys()
  18. 18. Internationalization Elements
  19. 19. Component Captions Caption text Dates Numerals Percentage
  20. 20. Need for Formatting? 12345678 US 12,345,678 EU 12.345.678
  21. 21. NumberFormat class getNumberInstance() getCurrencyInstance() getPercentInstance() format()
  22. 22. DateFormat class DateFormat getDateInstance (style, locale)
  23. 23. Formatting Message
  24. 24. It is not always possible to create agrammatically correct sentences withconcatenation of phrases and variables.
  25. 25. So we need MessageFormat.
  26. 26. Steps for MessageFormat. Identify variables Create template Create object array Create instance Apply and Format

×