Interface I18nProvider


public interface I18nProvider
Provides I18n translations translations / maps from a resource or locale
  • Method Summary

    Modifier and Type
    Method
    Description
    com.day.cq.i18n.I18n
    i18n(Locale locale)
    Provides the i18n map based on the underlying resource
    com.day.cq.i18n.I18n
    i18n(javax.servlet.http.HttpServletRequest request)
    Provides the i18n map based on the request
    com.day.cq.i18n.I18n
    i18n(org.apache.sling.api.resource.Resource resource)
    Provides the i18n map based on the underlying resource
    default com.day.cq.i18n.I18n
    i18n(org.apache.sling.api.resource.Resource resource, boolean localeIgnoreContent)
    Provides the i18n map based on the underlying resource
    translate(String key, Locale locale)
    Provides the translated value based on resource
    translate(String key, javax.servlet.http.HttpServletRequest request)
    Provides the translated value based on request
    translate(String key, org.apache.sling.api.resource.Resource resource)
    Provides the translated value based on resource
    default String
    translate(String key, org.apache.sling.api.resource.Resource resource, boolean localeIgnoreContent)
    Provides the translated value based on resource
  • Method Details

    • translate

      String translate(String key, org.apache.sling.api.resource.Resource resource)
      Provides the translated value based on resource
      Parameters:
      key - i18n key
      resource - underlying resource
      Returns:
      translated string
    • translate

      default String translate(String key, org.apache.sling.api.resource.Resource resource, boolean localeIgnoreContent)
      Provides the translated value based on resource
      Parameters:
      key - i18n key
      resource - underlying resource
      localeIgnoreContent - if true only the path is used to determine the language.
      Returns:
      translated string
      See Also:
      • Page.getLanguage(boolean)
    • translate

      String translate(String key, Locale locale)
      Provides the translated value based on resource
      Parameters:
      key - i18n key
      locale - locale
      Returns:
      translated string
    • translate

      String translate(String key, javax.servlet.http.HttpServletRequest request)
      Provides the translated value based on request
      Parameters:
      key - i18n key
      request - locale
      Returns:
      translated string
    • i18n

      com.day.cq.i18n.I18n i18n(org.apache.sling.api.resource.Resource resource)
      Provides the i18n map based on the underlying resource
      Parameters:
      resource - underlying resource
      Returns:
      i18n map
    • i18n

      default com.day.cq.i18n.I18n i18n(org.apache.sling.api.resource.Resource resource, boolean localeIgnoreContent)
      Provides the i18n map based on the underlying resource
      Parameters:
      resource - underlying resource
      localeIgnoreContent - if true only the path is used to determine the language.
      Returns:
      i18n map
      See Also:
      • Page.getLanguage(boolean)
    • i18n

      com.day.cq.i18n.I18n i18n(Locale locale)
      Provides the i18n map based on the underlying resource
      Parameters:
      locale - locale
      Returns:
      i18n map
    • i18n

      com.day.cq.i18n.I18n i18n(javax.servlet.http.HttpServletRequest request)
      Provides the i18n map based on the request
      Parameters:
      request - request
      Returns:
      i18n map