|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Role @Unstable public interface LocalizationManager
Internationalization service based on key/property values. The key is the id of the message being looked for, and the returned value is the message in the specified language.
Properties are looked for in several bundles, in the order of their
priority. The first translation found in one of these bundles is the one
returned. If the property is not found in any of these sources, then null is returned.
| Method Summary | |
|---|---|
Translation |
getTranslation(String key,
Locale locale)
Find a translation in the specified language. |
TranslationBundle |
getTranslationBundle(String bundleType,
String bundleId)
Find a bundle. |
void |
use(String bundleType,
String bundleId)
Registers a resource location as a possible localization bundle that should be used in the current execution. |
| Method Detail |
|---|
Translation getTranslation(String key,
Locale locale)
key - the key identifying the message to look forlocale - the locale of the target language
LocalizationManager
TranslationBundle getTranslationBundle(String bundleType,
String bundleId)
throws TranslationBundleDoesNotExistsException,
TranslationBundleFactoryDoesNotExistsException
bundleType - a hint identifying the bundle type.bundleId - the identifier of the bundle, for example a wiki document name, or the URL to a
.properties file.
TranslationBundle or null if none could be found
TranslationBundleDoesNotExistsException - when no bundle could be found for the passed identifier
TranslationBundleFactoryDoesNotExistsException - when no bundle factory could be found for the passed type
void use(String bundleType,
String bundleId)
throws TranslationBundleDoesNotExistsException,
TranslationBundleFactoryDoesNotExistsException
bundleType - a hint identifying the bundle type.bundleId - the identifier of the bindle, for example a wiki document name, or the URL to a
.properties file.
TranslationBundleDoesNotExistsException - when no bundle could be found for the passed identifier
TranslationBundleFactoryDoesNotExistsException - when no bundle factory could be found for the passed type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||