public final class Localizer extends Object
| Constructor and Description |
|---|
Localizer(Class<?> cls)
Constructs a Localizer which uses
java.text.MessageFormats
found in package_name.Messages_locale.properties
java.util.ResourceBundles to create its localized,
formatted, messages. |
| Modifier and Type | Method and Description |
|---|---|
String |
msg(String id)
Returns localized message having specified ID.
|
String |
msg(String id,
Object... args)
Returns localized message having specified ID and formatted using
specified arguments.
|
public Localizer(Class<?> cls)
java.text.MessageFormats
found in package_name.Messages_locale.properties
java.util.ResourceBundles to create its localized,
formatted, messages.
Example: com.xmlmind.foo.Messages_fr.properties, which is used to create localized, formatted, messages for all classes in the com.xmlmind.foo package, contains 2 message formats having cannotOpen and cannotSave as their IDs.
cannotOpen=Ne peut ouvrir le fichier "{0}":\n{1}
cannotSave=Ne peut enregistrer le fichier "{0}":\n{1}cls - Class used to specify package_name.