Wednesday, October 12, 2011

i18n APIs

If you’re designing an application that may be distributed to other nations, what you want to avoid is hardcoding English user text.

The following interfaces and objects are foundational to enable internationalization (i18n).

java.text package

Locale: Where is this running?

Resource Bundle: Alien language resource (LOL)

InputStreamReader OutputStreamWriter: UTF-8 and UTF-16

Internationalization is essential for a global impact


Abstraction, abstraction and more abstraction. Decouple everything with a minimal surface area allows for a low friction system. Internationalizing any application is probably a great test of software flexibility.

In order to prepare an application, several changes need to be considered:

1. Screen Text

2. Dates, Calendars

3. Numbers, Formats, Currency

4. Icons, Images

5. Text File formats (e.g. UTF-8, UTF-16).

 

It is possible that your program writes to ASCII, however that’s not going to work for the Japan market, you need to be able to write in UTF-16.