Package sji18n
Simple Java internationalization api - main entry point is class I18n
.
See:
Description
Interface Summary |
I18nable |
Classes that support locale context management (see general description in I18n ) must have some method
to set an instance's context. |
I18nListener |
Interface for listeners interested in locale changes. |
L10nResource |
Represents a localization resource. |
L10nResourceFactory |
I18n uses a L10nResourceFactory implementation to find and load actual resources. |
Class Summary |
I18n |
I18n instances provide easy access to locale-specific objects and the class's static methods allow an
application to manage its locale configuration. |
I18nEvent |
Represents events fired when a locale was changed in a particular context. |
Package sji18n Description
Simple Java internationalization api - main entry point is class I18n
.
Features:
- Supports a pluggable localization resource format and lookup mechanism.
- Supports renaming (often hard-coded) resource names at deploy time.
- Supports setting a different locale for logging messages and application objects.
- Supports dynamic locale switching by notifying interested listeners of locale changes.
- Supports multiple locale contexts within a single runtime.
Typical use is illustrated in the following example:
package some.pckg;
import sji18n.I18n;
public class SomeClass {
private static final Logger LOGGER = Logger.getLogger("some.pckg.SomeClass");
private static final I18n I18N = new I18n("SomeResource");
public void someMethod() {
...
try {
showUserMessageWithIcon(new ImageIcon(I18N.getImage("someImage")),
I18N.getMessage("someMessage", var1, var2));
...
LOGGER.log(Level.INFO, I18N.getLogMessage("onSomeSuccess", var3));
} catch (Exception e) {
LOGGER.log(Level.WARNING, I18N.getLogString("onSomeError"), e);
}
}
}