Package org.pf.nls

National Language Support
The main purpose of this package is to provide an easy to use mechanism for accessing localized text.

See:
          Description

Interface Summary
IExtendedTextProvider Defines additional methods for retrieving keys and checking contants.
ITextProvider Defines the minimal interface a class must implement in order to provide text for identifying keys.
 

Class Summary
NLSIniFileDetector This class is responsible to lookup the classpath for a specified base name to which it depends the file extension ".ini".
NLSIniFileLoader This loader is capable of reading text values from an NLS-ini file to one or more TextContainer objects.
NLSUtil Provides some utility and convenience methods related NLS.
ResourceBundleTextProvider This is a simple wrapper around a resource bundle to give it the same interface ITextProvider as available for a TextContainer.
TextContainer This is is a simple container for text strings associated with an identifying key.
TextContainerList Can hold many TextContainer objects which can be accessed via a locale name or a Locale object.
 

Package org.pf.nls Description

National Language Support


The main purpose of this package is to provide an easy to use mechanism for accessing localized text. It is an alternative to the java.lang.ResourceBundle which has some annoying design flaws.
One for example is that the text cannot be loaded from UTF-8 encoded properties files. The abstract class ResourceBundle intermingles lookup, loading and holding the data all in one class. But the real bad thing is that most methods are private or final and therefore this ABSTRACT class cannot reasonably be subclassed.

Another aspect addressed in this package is that spreading the localized text over several files (i.e. one per language) is also very cumbersome when changing or adding something.
That's the reason why this package follows a different approach. It puts the text of different languages together in one file and provides a loading mechanism that still is capable to retrive text for particular Locale only.

It also separates the loading of the text data and the container that is later used to get text for particular keys. That allows to extend the mechanism to load the texts from other sources as for example a database.



Copyright © 2015 Manfred Duchrow Consulting & Software. All rights reserved.