org.jtheque.core.managers.language
Interface ILanguageManager

All Known Implementing Classes:
LanguageManager

public interface ILanguageManager

Author:
Baptiste Wicht

Method Summary
 void addBasename(java.lang.String basename)
          Add an internationalization base name.
 void addInternationalizable(Internationalizable internationalizable)
          Add an internationalizable element.
 java.lang.String getCurrentLanguage()
          Return the current language.
 java.util.Locale getCurrentLocale()
          Return the current locale.
 java.lang.String[] getLinesMessage(java.lang.String key)
          Return all the lines of a message.
 java.lang.String getMessage(java.lang.String key)
          Return the message of the key.
 java.lang.String getMessage(java.lang.String key, java.lang.Object... replaces)
          Return the message of the key and effect the replaces.
 java.util.List<java.lang.String> getPossibleLanguages()
          Return all the supported languages.
 void removeBasename(java.lang.String basename)
          Remove a basename.
 void setCurrentLanguage(java.lang.String language)
          Set the current language.
 

Method Detail

addBasename

void addBasename(java.lang.String basename)
Add an internationalization base name.

Parameters:
basename - The basename to add.

setCurrentLanguage

void setCurrentLanguage(java.lang.String language)
Set the current language.

Parameters:
language - The language.

getCurrentLocale

java.util.Locale getCurrentLocale()
Return the current locale.

Returns:
The current locale.

getCurrentLanguage

java.lang.String getCurrentLanguage()
Return the current language.

Returns:
The current language.

getMessage

java.lang.String getMessage(java.lang.String key)
Return the message of the key. If there is no message with this key, the method return the key and log the message to the log system.

Parameters:
key - The message key.
Returns:
The message of the key of the current locale, empty string if the key is null else the key if there is no message for this key.

getLinesMessage

java.lang.String[] getLinesMessage(java.lang.String key)
Return all the lines of a message. The end line character used is \n.

Parameters:
key - The key of the message.
Returns:
An array containing all the lines of the internationalized message.

getMessage

java.lang.String getMessage(java.lang.String key,
                            java.lang.Object... replaces)
Return the message of the key and effect the replaces.

Parameters:
key - The message key.
replaces - The replacements.
Returns:
The message of the current locale with the replacements.

getPossibleLanguages

java.util.List<java.lang.String> getPossibleLanguages()
Return all the supported languages.

Returns:
A List containing all the supported languages.

addInternationalizable

void addInternationalizable(Internationalizable internationalizable)
Add an internationalizable element.

Parameters:
internationalizable - The internationalizable to add.

removeBasename

void removeBasename(java.lang.String basename)
Remove a basename.

Parameters:
basename - The basename to remove.


Copyright © 2009 JTheque. All Rights Reserved.