Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The I18nContentSupport interface

A When determining the preferred public locale, a key role in deciding which approach to apply to determine the preferred public locale is played by the 

Javadoc resource link
classNameinfo.magnolia.cms.i18n.I18nContentSupport
renderTypeasynchronous
 interface. Its configuration is stored under /server/i18n/content . The entry point to this interface is via the
Javadoc resource link
classNameinfo.magnolia.cms.i18n.I18nContentSupportFilter
renderTypeasynchronous
, usually  (set in /server/filters/i18n ). The I18nContentSupport interface has the following implementations:

  • Javadoc resource link
    classNameinfo.magnolia.cms.i18n.AbstractI18nContentSupport
    renderTypeasynchronous
     ,  – an abstract implementation which stores the locale specific content in node data having a locale suffix: <name>_<locale> . The detection of the current locale is left to one of the following three implementationsclasses.
  • Javadoc resource link
    classNameinfo.magnolia.cms.i18n.RequestLocaleAwareI18nContentSupport
    renderTypeasynchronous
     – relevant to the From the Accept-Language header case described above, this implementation reads the locale from the Accept-Language header. This implementation does not render language specific URIs (see the classes below).
  • Javadoc resource link
    classNameinfo.magnolia.cms.i18n.DefaultI18nContentSupport
    renderTypeasynchronous
     – relevant to the From Request-URI case described above and used in the Magnolia Travel Demo, this implementation supports a language prefix in the URI, such as de for example. It checks if a node data with the <name>_<locale> pattern exists on a content node:


  • Javadoc resource link
    classNameinfo.magnolia.cms.i18n.HierarchyBasedI18nContentSupport
    renderTypeasynchronous
    Same as above but for a hierarchy, for example:

    Code Block
    my-website
        ├─en
        │  ├─page-1
        │  └─page-n
        ├─de
        │  ├─page-1
        │  └─page-n 
        └─de_CH
           ├─page-1
           └─page-n 

    The locale code can be at whatever position in the URI, not necessarily the first one. For example, /my-website/node-1/node-2/de/home-page.html .

...