Class TranslationUtil

java.lang.Object
io.openems.edge.core.appmanager.TranslationUtil

public class TranslationUtil extends Object
  • Constructor Details

    • TranslationUtil

      public TranslationUtil()
  • Method Details

    • enableDebugMode

      public static TranslationUtil.DebugTranslator enableDebugMode()
      Enables the debug mode for getting translations.
      Returns:
      the TranslationUtil.DebugTranslator to get debug metrics.
    • disableDebugMode

      public static void disableDebugMode()
      Disables the debug mode.
    • getTranslation

      public static String getTranslation(ResourceBundle translationBundle, String key, Object... params)
      Gets the value for the given key from the translationBundle.
      Parameters:
      translationBundle - the translation bundle
      key - the key of the translation
      params - the parameter of the translation
      Returns:
      the translated string or the key if the translation was not found or the format is invalid
    • translate

      public static String translate(ResourceBundle translationBundle, String key, Object... params)
      Gets the value for the given key from the translationBundle.
      Parameters:
      translationBundle - the translation bundle
      key - the key of the translation
      params - the parameter of the translation
      Returns:
      the translated string or the key if the translation was not found or the format is invalid
    • getNullableTranslation

      public static String getNullableTranslation(ResourceBundle translationBundle, String key, Object... params)
      Gets the value for the given key from the translationBundle.
      Parameters:
      translationBundle - the translation bundle
      key - the key of the translation
      params - the parameter of the translation
      Returns:
      the translated string or null if the translation was not found or the format is invalid