public final class LocalisationTools
extends java.lang.Object
LocaleTools this also supports LocalisedStrings, that
are localised string representations of variables from the calling context. For instance model
elements like node or instance names will be localised in the message.| Constructor and Description |
|---|
LocalisationTools() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.util.Locale,java.lang.String> |
fillLocalisedMessage(java.util.Map<java.util.Locale,java.lang.String> localisedMessage,
java.lang.String msgKey,
java.lang.String bundleName,
java.util.List<java.util.Locale> locales,
java.lang.Class<?> localisingClass,
LocalisationFactory locFac,
LocalisedString... args)
Loads the designated message key from the designated bundle for the designated locales and
stores them in the designated map.
|
static java.lang.String |
getLocalisedMessage(java.lang.String msgKey,
java.lang.String bundleName,
java.util.Locale locale,
java.lang.Class<?> localisingClass,
LocalisationFactory locFac,
LocalisedString... args)
Gets the localised message for the designated message key from the designated bundle for the
designated locale.
|
public static java.lang.String getLocalisedMessage(java.lang.String msgKey,
java.lang.String bundleName,
java.util.Locale locale,
java.lang.Class<?> localisingClass,
LocalisationFactory locFac,
LocalisedString... args)
msgKey - The message key with which to retrieve the localisation from the resource bundle.bundleName - The name of the resource bundle.locale - The locale for which to retrieve the localisation for the designated message key.localisingClass - The class that is performing the localisation. This is used for loading
the resource bundle.locFac - The localisation factory for localising the strings. If this is
null, no special localisation will be applied to the strings.args - Optional arguments localised and afterwards passed to the corresponding localised
message using String.format(Locale, String, Object...).LocaleTools.getLocalisedMessage(String, String, Locale, Class,
Object...)public static java.util.Map<java.util.Locale,java.lang.String> fillLocalisedMessage(java.util.Map<java.util.Locale,java.lang.String> localisedMessage,
java.lang.String msgKey,
java.lang.String bundleName,
java.util.List<java.util.Locale> locales,
java.lang.Class<?> localisingClass,
LocalisationFactory locFac,
LocalisedString... args)
localisedMessage - The map to store the localised message with the locale of the
corresponding resource bundle as key. If this is null a new map will be
created and returned.msgKey - The message key with which to retrieve the localisation from the resource
bundles.bundleName - The name of the resource bundle.locales - The locales for which to retrieve localisations for the designated message key.localisingClass - The class that is performing the localisation. This is used for loading
the resource bundle.locFac - The localisation factory for localising the strings. If this is
null, no special localisation will be applied to the strings.args - Optional arguments localised and afterwards passed to the corresponding localised
message using String.format(Locale, String, Object...).null is provided. If null is provided a new map will
be created.LocaleTools.fillLocalisedMessage(Map, String, String, List,
Class, Object...)