Class TranslationUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Supplier<Translations>Deprecated.Users might need to stub the translations for their unit tests. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetTranslation(String key) Deprecated.Gets the translation for a given key using the UI language of the current session, if this has been set.static StringgetTranslation(String key, String languageCode) Deprecated.Gets the translation for a given key and language.static StringDeprecated.Gets the translation with replaced parameters for a given key using the given language If language is empty or no translation can be found, the key is returned.static TranslationsDeprecated.Gets all translations configured on this PubServer instance as configured in ISONgetTranslations(String languageCode) Deprecated.Gets all translations for a given language as a simple Map<String,String>
-
Field Details
-
translationsSupplier
Deprecated.Users might need to stub the translations for their unit tests. As this is a static class with static methods, a static supplier setting is offered. This should only be set if a manual override of Translations providers is required which usually only happens in test scopes.
-
-
Method Details
-
getTranslations
Deprecated.Gets all translations configured on this PubServer instance as configured in ISON
- Returns:
- all available translations as Translations object
-
getTranslation
Deprecated.Gets the translation for a given key using the UI language of the current session, if this has been set. If language is empty or no translation can be found, the key is returned.
- Parameters:
key- key of the translation entry- Returns:
- localized String or key, if no language is set for this session or no translation can be found
-
getTranslation
Deprecated.Gets the translation with replaced parameters for a given key using the given language If language is empty or no translation can be found, the key is returned.
- Parameters:
key- key of the translation entrylanguageCode- 2 digit language code, e.g. "en" or "de"parameters- Key Value List of parameters to replace- Returns:
- localized String or key, if no language is set for this session or no translation can be found
-
getTranslation
Deprecated.Gets the translation for a given key and language. If either language is null or empty, key cannot be found or no translation can be found for this key / language, the original key is returned.
- Parameters:
key- key of the translation entrylanguageCode- 2 digit language code, e.g. "en" or "de"- Returns:
- translation for the given key / language, or key, if no translation can be found
-
getTranslations
Deprecated.Gets all translations for a given language as a simple Map<String,String>
Gets all available translations for a given language as a String Map using the entry key as key and translation as value
- Parameters:
languageCode- 2 digit language code, e.g. "en" or "de"- Returns:
- all translations as Map<String,String>
-
This Utility class refers to the PriintPlanner Plugin, which is subject to be removed in PublishingServer 2024/2. Please use the new utility class
TranslationUtilsThe TranslationUtils class provides methods to easily access translations configured on this PubServer instance.