public class Localizer extends Object
Each class that uses String that reach the user interface has its own Localizer. You can get a localized String by using one of the msg methods.
The msg methods have all the same pattern:
String msg(key, defaultValue, [args]);
key
is a String that identifies the message. Each class
has its own namespace.args
are arguments that will be parsed into the
message. See MessageFormat
for details.
Modifier and Type | Method and Description |
---|---|
static void |
emptyLocalizerCache()
Clears the localizer cache.
|
static Localizer |
getLocalizerFor(Class clazz)
Gets the Localizer for the specified Class.
|
String |
msg(String key,
String defaultMsg)
Gets a localized message.
|
String |
msg(String key,
String defaultMsg,
Object arg1)
Gets a localized message.
|
String |
msg(String key,
String defaultMsg,
Object[] args)
Gets a localized message.
|
String |
msg(String key,
String defaultMsg,
Object arg1,
Object arg2)
Gets a localized message.
|
String |
msg(String key,
String defaultMsg,
Object arg1,
Object arg2,
Object arg3)
Gets a localized message.
|
public static Localizer getLocalizerFor(Class clazz)
clazz
- The Class to get the localizer for.public static void emptyLocalizerCache()
public String msg(String key, String defaultMsg, Object arg1)
key
- The key of the message.defaultMsg
- The default message. (english)arg1
- The argument that should replace {0}
.public String msg(String key, String defaultMsg, Object arg1, Object arg2)
key
- The key of the message.defaultMsg
- The default message. (english)arg1
- The argument that should replace {0}
.arg2
- The argument that should replace {1}
.public String msg(String key, String defaultMsg, Object arg1, Object arg2, Object arg3)
key
- The key of the message.defaultMsg
- The default message. (english)arg1
- The argument that should replace {0}
.arg2
- The argument that should replace {1}
.arg3
- The argument that should replace {2}
.public String msg(String key, String defaultMsg, Object[] args)
key
- The key of the message.defaultMsg
- The default message. (english)args
- The arguments that should replace the appropriate place holder.
See MessageFormat
for details.TV-Browser 2.2.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)