Class AddonI18nLocalizationService

java.lang.Object
org.openhab.core.addon.AddonI18nLocalizationService

@NonNullByDefault public class AddonI18nLocalizationService extends Object
This OSGi service could be used to localize the add-on info using the I18N mechanism of the openHAB framework.
Author:
Christoph Weitkamp - Initial contribution
  • Constructor Details

    • AddonI18nLocalizationService

      public AddonI18nLocalizationService(TranslationProvider i18nProvider)
  • Method Details

    • createLocalizedAddonInfo

      public AddonInfo createLocalizedAddonInfo(org.osgi.framework.Bundle bundle, AddonInfo addonInfo, @Nullable Locale locale)
      Localizes an add-on info.
      Parameters:
      bundle - the bundle the i18n resources are located
      addonInfo - the add-on info that should be localized
      locale - the locale it should be localized to
      Returns:
      a localized add-on info on success, a non-localized one on error (e.g. no translation is found).