Interface ModuleResourceAccess

All Known Implementing Classes:
ModuleResourceAccessImpl

public interface ModuleResourceAccess
Interface to access resources by module specific resource keys.

The module specific resource key needs to be in the following format: <moduleId>.key (Example: myModule.myKey)

The bundle determination works with help of GlobalConfigurationManager where all extension names for a sap module id are accessible. The bundle needs to comply to the following naming convention <extensionName>-locales_<locale>.

  • Method Summary

    Modifier and Type
    Method
    Description
    getString(String resourceKey)
    Translate the given key with the standard locale.
    getString(String resourceKey, Object[] args)
    Translate the given key with the default Locale replacing the passed arguments.
    getString(String resourceKey, Locale locale)
    Translate the given key with the given locale.
    getString(String resourceKey, Locale locale, Object[] args)
    Translate the given key with the given locale replacing the passed arguments.
  • Method Details

    • getString

      String getString(String resourceKey)
      Translate the given key with the standard locale.
      Parameters:
      resourceKey - resource key
      Returns:
      translated resource string
    • getString

      String getString(String resourceKey, Locale locale)
      Translate the given key with the given locale.
      Parameters:
      resourceKey - resource key
      locale - locale
      Returns:
      translated resource string
    • getString

      String getString(String resourceKey, Object[] args)
      Translate the given key with the default Locale replacing the passed arguments.
      Parameters:
      resourceKey - resource key
      args - arguments
      Returns:
      translated resource string
    • getString

      String getString(String resourceKey, Locale locale, Object[] args)
      Translate the given key with the given locale replacing the passed arguments.
      Parameters:
      resourceKey - resource key
      locale - locale
      args - arguments
      Returns:
      translated resource string