Package com.lf.commons.i18n

Provides support for internationalization (charets and ISO 639-1/639-2 language codes).

See: Description

Package com.lf.commons.i18n Description

Provides support for internationalization (charets and ISO 639-1/639-2 language codes).

The term "i18n" is a short for the exceptionally long word "internationalization". Like the CharsetEncoder and CharsetDecoder classes from Sun the class CharsetConverter supports the conversion from/to Unicode (currently 3.0.1) which turned out to be an ideal superset for solving charset issues. Since the Sun classes are a bit too complex for the KAT framework, I decided to implement my own classes for solving common charset conversion problems. They are easy to use, easy to maintain, and also easily extended by simply adding more resource file-based encoding/Unicode mappings.

The other functionality block is the ISO 639-1/639-2 code. The central class here is LanguageCodes providing the functionality to request language codes and names according to the ISO standards 639-1 (Alpha-2) and 639-2 (Alpha-3). Also this class is based on resource files with definitions of language names and codes and can therefore be easily extended. Another key feature of this class is the translation support. At the moment the default language for language names is English. If you like to use a different language for example while running web applications you may equip the name-related methods of this class with a lang parameter. You can pass both ISO 639-1 codes or ISO 639-2 codes for determining the desired language (e.g. "fr" for French). At the moment German and French are supported as translations.

Since most of the classes of this subpackage hold static data developers should make use of the I18NFactory class whenever possible. This class provides shared instances which can reduce the memory footprint of your application significantly while keeping a good performance (caching).

 Copyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.