|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object util.ui.Localizer
public class Localizer
Does the localization of texts.
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.
Field Summary | |
---|---|
static java.lang.String |
I18N_ADD
|
static java.lang.String |
I18N_BACK
|
static java.lang.String |
I18N_CANCEL
|
static java.lang.String |
I18N_CHANNEL
|
static java.lang.String |
I18N_CHANNELS
|
static java.lang.String |
I18N_CLOSE
|
static java.lang.String |
I18N_DEFAULT
|
static java.lang.String |
I18N_DELETE
|
static java.lang.String |
I18N_DOWN
|
static java.lang.String |
I18N_EDIT
|
static java.lang.String |
I18N_ERROR
|
static java.lang.String |
I18N_FILE
|
static java.lang.String |
I18N_HELP
|
static java.lang.String |
I18N_INFO
|
static java.lang.String |
I18N_LEFT
|
static java.lang.String |
I18N_NEXT
|
static java.lang.String |
I18N_OK
|
static java.lang.String |
I18N_OPTIONS
|
static java.lang.String |
I18N_PICTURES
|
static java.lang.String |
I18N_PROGRAM
|
static java.lang.String |
I18N_PROGRAMS
|
static java.lang.String |
I18N_RIGHT
|
static java.lang.String |
I18N_SELECT
|
static java.lang.String |
I18N_SETTINGS
|
static java.lang.String |
I18N_STANDARD
|
static java.lang.String |
I18N_TODAY
|
static java.lang.String |
I18N_TOMORROW
|
static java.lang.String |
I18N_UP
|
static java.lang.String |
I18N_WARNING
|
static java.lang.String |
I18N_YESTERDAY
|
Constructor Summary | |
---|---|
protected |
Localizer(java.lang.Class clazz)
Creates a new instance of Localizer. |
Method Summary | |
---|---|
protected static void |
addLocalizerToCache(java.lang.Class clazz,
Localizer localizer)
|
java.lang.String |
ellipsis(java.lang.String someString)
return the given String with an ellipsis appended |
java.lang.String |
ellipsisMsg(java.lang.String key,
java.lang.String defaultMessage)
get a localized message with an ellipsis as suffix |
java.lang.String |
ellipsisMsg(java.lang.String key,
java.lang.String defaultMsg,
java.lang.Object arg1)
Gets a localized message ending with ellipsis suffix |
static void |
emptyLocalizerCache()
Clears the localizer cache. |
java.util.Locale[] |
getAllAvailableLocales()
Scans all Language-Directories for different Versions of tvbrowser/tvbrowser.properties. |
protected static Localizer |
getCachedLocalizerFor(java.lang.Class clazz)
|
static java.lang.String |
getEllipsisLocalization(java.lang.String key)
get a standard localization with ellipsis as suffix |
static java.util.Locale |
getLocaleForString(java.lang.String string)
Get the Locale for a specific String. |
static java.lang.String |
getLocalization(java.lang.String key)
get a standard localization |
static Localizer |
getLocalizerFor(java.lang.Class clazz)
Gets the Localizer for the specified Class. |
boolean |
hasMessage(java.lang.String key)
check if a given message key exists |
protected void |
initializeForClass(java.lang.Class clazz)
|
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg)
Gets a localized message. |
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg,
boolean warn)
Gets a localized message. |
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg,
java.lang.Object arg1)
Gets a localized message. |
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg,
java.lang.Object[] args)
Gets a localized message. |
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg,
java.lang.Object arg1,
java.lang.Object arg2)
Gets a localized message. |
java.lang.String |
msg(java.lang.String key,
java.lang.String defaultMsg,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Gets a localized message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String I18N_OK
public static final java.lang.String I18N_CANCEL
public static final java.lang.String I18N_CLOSE
public static final java.lang.String I18N_DELETE
public static final java.lang.String I18N_EDIT
public static final java.lang.String I18N_PROGRAM
public static final java.lang.String I18N_PROGRAMS
public static final java.lang.String I18N_CHANNEL
public static final java.lang.String I18N_CHANNELS
public static final java.lang.String I18N_HELP
public static final java.lang.String I18N_FILE
public static final java.lang.String I18N_ADD
public static final java.lang.String I18N_SETTINGS
public static final java.lang.String I18N_UP
public static final java.lang.String I18N_DOWN
public static final java.lang.String I18N_LEFT
public static final java.lang.String I18N_RIGHT
public static final java.lang.String I18N_BACK
public static final java.lang.String I18N_NEXT
public static final java.lang.String I18N_PICTURES
public static final java.lang.String I18N_OPTIONS
public static final java.lang.String I18N_SELECT
public static final java.lang.String I18N_ERROR
public static final java.lang.String I18N_DEFAULT
public static final java.lang.String I18N_STANDARD
public static final java.lang.String I18N_YESTERDAY
public static final java.lang.String I18N_TODAY
public static final java.lang.String I18N_TOMORROW
public static final java.lang.String I18N_INFO
public static final java.lang.String I18N_WARNING
Constructor Detail |
---|
protected Localizer(java.lang.Class clazz)
clazz
- The Class to create the Localizer for.Method Detail |
---|
protected void initializeForClass(java.lang.Class clazz)
protected static Localizer getCachedLocalizerFor(java.lang.Class clazz)
public static Localizer getLocalizerFor(java.lang.Class clazz)
clazz
- The Class to get the localizer for.
protected static void addLocalizerToCache(java.lang.Class clazz, Localizer localizer)
public static void emptyLocalizerCache()
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
key
- The key of the message.defaultMsg
- The default message (English)arg1
- The argument that should replace {0}
.
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1, java.lang.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 java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1, java.lang.Object arg2, java.lang.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 java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.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 java.lang.String msg(java.lang.String key, java.lang.String defaultMsg)
key
- The key of the message.defaultMsg
- The default message (English)
public java.lang.String msg(java.lang.String key, java.lang.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 java.util.Locale[] getAllAvailableLocales()
public static java.util.Locale getLocaleForString(java.lang.String string)
string
- String with Locale
public static java.lang.String getLocalization(java.lang.String key)
key
- one of the constant values defined in the Localizer class
public static java.lang.String getEllipsisLocalization(java.lang.String key)
key
- one of the constant values defined in the Localizer class
public java.lang.String ellipsisMsg(java.lang.String key, java.lang.String defaultMessage)
key
- localization keydefaultMessage
- default (English) message
public java.lang.String ellipsisMsg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
key
- The key of the message.defaultMsg
- The default message (English)arg1
- The argument that should replace {0}
.
public boolean hasMessage(java.lang.String key)
key
-
public java.lang.String ellipsis(java.lang.String someString)
someString
-
null
|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |