- java.lang.Object
-
- util.ui.Localizer
-
- Direct Known Subclasses:
PooledLocalizer
@Deprecated(since="4.2.2") public class Localizer extends java.lang.Object
Deprecated.since 4.2.2 use {@link #util.i18n.Localizer} instead.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]);
- The
key
is a String that identifies the message. Each class has its own namespace. - The defaultValue is the value you would expect on an English system. (But note: Even on an English system you may get a different String!)
- The optional
args
are arguments that will be parsed into the message. SeeMessageFormat
for details.
- Author:
- Til Schneider, www.murfman.de
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
I18N_ADD
Deprecated.static java.lang.String
I18N_BACK
Deprecated.static java.lang.String
I18N_CANCEL
Deprecated.static java.lang.String
I18N_CHANNEL
Deprecated.static java.lang.String
I18N_CHANNELS
Deprecated.static java.lang.String
I18N_CLEAR_SELECTION
Deprecated.static java.lang.String
I18N_CLOSE
Deprecated.static java.lang.String
I18N_COPY
Deprecated.static java.lang.String
I18N_DEFAULT
Deprecated.static java.lang.String
I18N_DELETE
Deprecated.static java.lang.String
I18N_DOWN
Deprecated.static java.lang.String
I18N_EDIT
Deprecated.static java.lang.String
I18N_ERROR
Deprecated.static java.lang.String
I18N_FILE
Deprecated.static java.lang.String
I18N_HELP
Deprecated.static java.lang.String
I18N_INFO
Deprecated.static java.lang.String
I18N_LEFT
Deprecated.static java.lang.String
I18N_NEXT
Deprecated.static java.lang.String
I18N_OK
Deprecated.static java.lang.String
I18N_OPTIONS
Deprecated.static java.lang.String
I18N_PICTURES
Deprecated.static java.lang.String
I18N_PROGRAM
Deprecated.static java.lang.String
I18N_PROGRAMS
Deprecated.static java.lang.String
I18N_RIGHT
Deprecated.static java.lang.String
I18N_SELECT
Deprecated.static java.lang.String
I18N_SELECT_ALL
Deprecated.static java.lang.String
I18N_SETTINGS
Deprecated.static java.lang.String
I18N_STANDARD
Deprecated.static java.lang.String
I18N_TODAY
Deprecated.static java.lang.String
I18N_TOMORROW
Deprecated.static java.lang.String
I18N_UP
Deprecated.static java.lang.String
I18N_WARNING
Deprecated.static java.lang.String
I18N_YESTERDAY
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Localizer(java.lang.Class<?> clazz)
Deprecated.Creates a new instance of Localizer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static void
addLocalizerToCache(java.lang.Class<?> clazz, Localizer localizer)
Deprecated.java.lang.String
ellipsis(java.lang.String someString)
Deprecated.return the given String with an ellipsis appendedjava.lang.String
ellipsisMsg(java.lang.String key, java.lang.String defaultMessage)
Deprecated.get a localized message with an ellipsis as suffixjava.lang.String
ellipsisMsg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
Deprecated.Gets a localized message ending with ellipsis suffixstatic void
emptyLocalizerCache()
Deprecated.Clears the localizer cache.java.util.Locale[]
getAllAvailableLocales()
Deprecated.Scans all Language-Directories for different Versions of tvbrowser/tvbrowser.properties.protected static Localizer
getCachedLocalizerFor(java.lang.Class<?> clazz)
Deprecated.static java.lang.String
getEllipsisLocalization(java.lang.String key)
Deprecated.get a standard localization with ellipsis as suffixstatic java.util.Locale
getLocaleForString(java.lang.String string)
Deprecated.Get the Locale for a specific String.static java.lang.String
getLocalization(java.lang.String key)
Deprecated.get a standard localizationstatic Localizer
getLocalizerFor(java.lang.Class<?> clazz)
Deprecated.Gets the Localizer for the specified Class.boolean
hasMessage(java.lang.String key)
Deprecated.check if a given message key existsprotected void
initializeForClass(java.lang.Class<?> clazz)
Deprecated.java.lang.String
msg(java.lang.String key, java.lang.String defaultMsg)
Deprecated.Gets a localized message.java.lang.String
msg(java.lang.String key, java.lang.String defaultMsg, boolean warn)
Deprecated.Gets a localized message.java.lang.String
msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
Deprecated.Gets a localized message.java.lang.String
msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object[] args)
Deprecated.Gets a localized message.java.lang.String
msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1, java.lang.Object arg2)
Deprecated.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)
Deprecated.Gets a localized message.
-
-
-
Field Detail
-
I18N_OK
public static final java.lang.String I18N_OK
Deprecated.- See Also:
- Constant Field Values
-
I18N_CANCEL
public static final java.lang.String I18N_CANCEL
Deprecated.- See Also:
- Constant Field Values
-
I18N_CLOSE
public static final java.lang.String I18N_CLOSE
Deprecated.- See Also:
- Constant Field Values
-
I18N_COPY
public static final java.lang.String I18N_COPY
Deprecated.- See Also:
- Constant Field Values
-
I18N_DELETE
public static final java.lang.String I18N_DELETE
Deprecated.- See Also:
- Constant Field Values
-
I18N_EDIT
public static final java.lang.String I18N_EDIT
Deprecated.- See Also:
- Constant Field Values
-
I18N_PROGRAM
public static final java.lang.String I18N_PROGRAM
Deprecated.- See Also:
- Constant Field Values
-
I18N_PROGRAMS
public static final java.lang.String I18N_PROGRAMS
Deprecated.- See Also:
- Constant Field Values
-
I18N_CHANNEL
public static final java.lang.String I18N_CHANNEL
Deprecated.- See Also:
- Constant Field Values
-
I18N_CHANNELS
public static final java.lang.String I18N_CHANNELS
Deprecated.- See Also:
- Constant Field Values
-
I18N_HELP
public static final java.lang.String I18N_HELP
Deprecated.- See Also:
- Constant Field Values
-
I18N_FILE
public static final java.lang.String I18N_FILE
Deprecated.- See Also:
- Constant Field Values
-
I18N_ADD
public static final java.lang.String I18N_ADD
Deprecated.- See Also:
- Constant Field Values
-
I18N_SETTINGS
public static final java.lang.String I18N_SETTINGS
Deprecated.- See Also:
- Constant Field Values
-
I18N_UP
public static final java.lang.String I18N_UP
Deprecated.- See Also:
- Constant Field Values
-
I18N_DOWN
public static final java.lang.String I18N_DOWN
Deprecated.- See Also:
- Constant Field Values
-
I18N_LEFT
public static final java.lang.String I18N_LEFT
Deprecated.- See Also:
- Constant Field Values
-
I18N_RIGHT
public static final java.lang.String I18N_RIGHT
Deprecated.- See Also:
- Constant Field Values
-
I18N_BACK
public static final java.lang.String I18N_BACK
Deprecated.- See Also:
- Constant Field Values
-
I18N_NEXT
public static final java.lang.String I18N_NEXT
Deprecated.- See Also:
- Constant Field Values
-
I18N_PICTURES
public static final java.lang.String I18N_PICTURES
Deprecated.- See Also:
- Constant Field Values
-
I18N_OPTIONS
public static final java.lang.String I18N_OPTIONS
Deprecated.- See Also:
- Constant Field Values
-
I18N_SELECT
public static final java.lang.String I18N_SELECT
Deprecated.- See Also:
- Constant Field Values
-
I18N_SELECT_ALL
public static final java.lang.String I18N_SELECT_ALL
Deprecated.- See Also:
- Constant Field Values
-
I18N_CLEAR_SELECTION
public static final java.lang.String I18N_CLEAR_SELECTION
Deprecated.- See Also:
- Constant Field Values
-
I18N_ERROR
public static final java.lang.String I18N_ERROR
Deprecated.- See Also:
- Constant Field Values
-
I18N_DEFAULT
public static final java.lang.String I18N_DEFAULT
Deprecated.- See Also:
- Constant Field Values
-
I18N_STANDARD
public static final java.lang.String I18N_STANDARD
Deprecated.- See Also:
- Constant Field Values
-
I18N_YESTERDAY
public static final java.lang.String I18N_YESTERDAY
Deprecated.- See Also:
- Constant Field Values
-
I18N_TODAY
public static final java.lang.String I18N_TODAY
Deprecated.- See Also:
- Constant Field Values
-
I18N_TOMORROW
public static final java.lang.String I18N_TOMORROW
Deprecated.- See Also:
- Constant Field Values
-
I18N_INFO
public static final java.lang.String I18N_INFO
Deprecated.- See Also:
- Constant Field Values
-
I18N_WARNING
public static final java.lang.String I18N_WARNING
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
initializeForClass
protected void initializeForClass(java.lang.Class<?> clazz)
Deprecated.
-
getCachedLocalizerFor
protected static Localizer getCachedLocalizerFor(java.lang.Class<?> clazz)
Deprecated.
-
getLocalizerFor
public static Localizer getLocalizerFor(java.lang.Class<?> clazz)
Deprecated.Gets the Localizer for the specified Class.- Parameters:
clazz
- The Class to get the localizer for.- Returns:
- the Localizer for the specified Class.
-
addLocalizerToCache
protected static void addLocalizerToCache(java.lang.Class<?> clazz, Localizer localizer)
Deprecated.
-
emptyLocalizerCache
public static void emptyLocalizerCache()
Deprecated.Clears the localizer cache.
-
msg
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
Deprecated.Gets a localized message.- Parameters:
key
- The key of the message.defaultMsg
- The default message (English)arg1
- The argument that should replace{0}
.- Returns:
- a localized message.
-
msg
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1, java.lang.Object arg2)
Deprecated.Gets a localized message.- Parameters:
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}
.- Returns:
- a localized message.
-
msg
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)
Deprecated.Gets a localized message.- Parameters:
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}
.- Returns:
- a localized message.
-
msg
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object[] args)
Deprecated.Gets a localized message.- Parameters:
key
- The key of the message.defaultMsg
- The default message. (English)args
- The arguments that should replace the appropriate place holder. SeeMessageFormat
for details.- Returns:
- a localized message.
-
msg
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg)
Deprecated.Gets a localized message.- Parameters:
key
- The key of the message.defaultMsg
- The default message (English)- Returns:
- a localized message.
-
msg
public java.lang.String msg(java.lang.String key, java.lang.String defaultMsg, boolean warn)
Deprecated.Gets a localized message.- Parameters:
key
- The key of the message.defaultMsg
- The default message (English)warn
- If warnings should be logged if key is not found.- Returns:
- a localized message.
- Since:
- 2.5.1
-
getAllAvailableLocales
public java.util.Locale[] getAllAvailableLocales()
Deprecated.Scans all Language-Directories for different Versions of tvbrowser/tvbrowser.properties. This is faster than analyzing all Files- Returns:
- all available Locales
- Since:
- 2.3
-
getLocaleForString
public static java.util.Locale getLocaleForString(java.lang.String string)
Deprecated.Get the Locale for a specific String. The String is in this format: "lang_country_variant"- Parameters:
string
- String with Locale- Returns:
- Locale
-
getLocalization
public static java.lang.String getLocalization(java.lang.String key)
Deprecated.get a standard localization- Parameters:
key
- one of the constant values defined in the Localizer class- Returns:
- localized message for key
-
getEllipsisLocalization
public static java.lang.String getEllipsisLocalization(java.lang.String key)
Deprecated.get a standard localization with ellipsis as suffix- Parameters:
key
- one of the constant values defined in the Localizer class- Returns:
- localized message for key
-
ellipsisMsg
public java.lang.String ellipsisMsg(java.lang.String key, java.lang.String defaultMessage)
Deprecated.get a localized message with an ellipsis as suffix- Parameters:
key
- localization keydefaultMessage
- default (English) message- Returns:
- localized message
- Since:
- 3.0
-
ellipsisMsg
public java.lang.String ellipsisMsg(java.lang.String key, java.lang.String defaultMsg, java.lang.Object arg1)
Deprecated.Gets a localized message ending with ellipsis suffix- Parameters:
key
- The key of the message.defaultMsg
- The default message (English)arg1
- The argument that should replace{0}
.- Returns:
- a localized message.
-
hasMessage
public boolean hasMessage(java.lang.String key)
Deprecated.check if a given message key exists- Parameters:
key
- The key- Returns:
- true if the given key exists
- Since:
- 3.0
-
ellipsis
public java.lang.String ellipsis(java.lang.String someString)
Deprecated.return the given String with an ellipsis appended- Parameters:
someString
- The string.- Returns:
- ellipsis appended String or
null
- Since:
- 3.0
-
-