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 | Field and Description |
---|---|
static String |
I18N_ADD |
static String |
I18N_BACK |
static String |
I18N_CANCEL |
static String |
I18N_CHANNEL |
static String |
I18N_CHANNELS |
static String |
I18N_CLOSE |
static String |
I18N_DEFAULT |
static String |
I18N_DELETE |
static String |
I18N_DOWN |
static String |
I18N_EDIT |
static String |
I18N_ERROR |
static String |
I18N_FILE |
static String |
I18N_HELP |
static String |
I18N_LEFT |
static String |
I18N_NEXT |
static String |
I18N_OK |
static String |
I18N_OPTIONS |
static String |
I18N_PICTURES |
static String |
I18N_PROGRAM |
static String |
I18N_PROGRAMS |
static String |
I18N_RIGHT |
static String |
I18N_SELECT |
static String |
I18N_SETTINGS |
static String |
I18N_STANDARD |
static String |
I18N_TODAY |
static String |
I18N_TOMORROW |
static String |
I18N_UP |
static String |
I18N_YESTERDAY |
Modifier and Type | Method and Description |
---|---|
static void |
emptyLocalizerCache()
Clears the localizer cache.
|
Locale[] |
getAllAvailableLocales()
Scans all Language-Directories for different Versions of tvbrowser/tvbrowser.properties.
|
static String |
getLocalization(String key) |
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,
boolean warn)
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 final String I18N_OK
public static final String I18N_CANCEL
public static final String I18N_CLOSE
public static final String I18N_DELETE
public static final String I18N_EDIT
public static final String I18N_PROGRAM
public static final String I18N_PROGRAMS
public static final String I18N_CHANNEL
public static final String I18N_CHANNELS
public static final String I18N_HELP
public static final String I18N_FILE
public static final String I18N_ADD
public static final String I18N_SETTINGS
public static final String I18N_UP
public static final String I18N_DOWN
public static final String I18N_LEFT
public static final String I18N_RIGHT
public static final String I18N_BACK
public static final String I18N_NEXT
public static final String I18N_PICTURES
public static final String I18N_OPTIONS
public static final String I18N_SELECT
public static final String I18N_ERROR
public static final String I18N_DEFAULT
public static final String I18N_STANDARD
public static final String I18N_YESTERDAY
public static final String I18N_TODAY
public static final String I18N_TOMORROW
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.public String msg(String key, String defaultMsg)
key
- The key of the message.defaultMsg
- The default message (English)public String msg(String key, String defaultMsg, boolean warn)
key
- The key of the message.defaultMsg
- The default message (English)warn
- If warnings should be logged if key is not found.public Locale[] getAllAvailableLocales()
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)