Package org.xwiki.localization
Interface ContextualLocalizationManager
-
@Role public interface ContextualLocalizationManager
A helper forLocalizationManager
which get theLocale
fromLocalizationContext
and provide various common use cases methods.- Since:
- 5.0M1
- Version:
- $Id: c3064d7ab963b236e0a3d332913de4629058f6bc $
- See Also:
LocalizationManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Translation
getTranslation(String key)
Find a translation in the current language.default String
getTranslation(String key, org.xwiki.rendering.syntax.Syntax targetSyntax, Object... parameters)
Find a translation in the current language.String
getTranslationPlain(String key, Object... parameters)
Find a translation in the current language.
-
-
-
Method Detail
-
getTranslation
Translation getTranslation(String key)
Find a translation in the current language.- Parameters:
key
- the key identifying the message to look for- Returns:
- the translation in the current language, null if no translation could be found
- See Also:
LocalizationManager.getTranslation(String, java.util.Locale)
,LocalizationContext.getCurrentLocale()
-
getTranslationPlain
String getTranslationPlain(String key, Object... parameters)
Find a translation in the current language.- Parameters:
key
- the key identifying the message to look forparameters
- the parameters- Returns:
- the translation in the current language rendered as plain text, null if no translation could be found
- See Also:
getTranslation(String)
-
getTranslation
@Unstable default String getTranslation(String key, org.xwiki.rendering.syntax.Syntax targetSyntax, Object... parameters) throws LocalizationException
Find a translation in the current language.- Parameters:
key
- the key identifying the message to look fortargetSyntax
- the syntax in which to render the translationparameters
- the parameters- Returns:
- the translation in the current language, rendered in the target syntax, null if no translation could be found or it couldn't be rendered
- Throws:
LocalizationException
- if there's an error while getting the Renderer for the passed syntax- Since:
- 15.5RC1, 14.10.12
- See Also:
getTranslation(String)
-
-