Class TranslationUtils

java.lang.Object
com.priint.pubserver.util.TranslationUtils

@Deprecated public class TranslationUtils extends Object
Deprecated.

This Utility class refers to the PriintPlanner Plugin, which is subject to be removed in PublishingServer 2024/2. Please use the new utility class TranslationUtils

The TranslationUtils class provides methods to easily access translations configured on this PubServer instance.

  • Field Details

    • translationsSupplier

      public static Supplier<Translations> 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

      public static Translations getTranslations()
      Deprecated.

      Gets all translations configured on this PubServer instance as configured in ISON

      Returns:
      all available translations as Translations object
    • getTranslation

      public static String getTranslation(String key)
      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

      public static String getTranslation(String key, String languageCode, Map<String,String> parameters)
      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 entry
      languageCode - 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

      public static String getTranslation(String key, String languageCode)
      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 entry
      languageCode - 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

      public static Map<String,String> getTranslations(String languageCode)
      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>