Package com.xmlmind.util
Class Localizer
- java.lang.Object
-
- com.xmlmind.util.Localizer
-
public final class Localizer extends Object
Helper class used to create localized, formatted, messages.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
Localizer
public Localizer(Class<?> cls)
Constructs a Localizer which usesjava.text.MessageFormat
s found inpackage_name.Messages_locale.properties
java.util.ResourceBundle
s 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 thecom.xmlmind.foo
package, contains 2 message formats havingcannotOpen
andcannotSave
as their IDs.cannotOpen=Ne peut ouvrir le fichier "{0}":\n{1} cannotSave=Ne peut enregistrer le fichier "{0}":\n{1}
- Parameters:
cls
- Class used to specify package_name.
-
-