Page tree
Skip to end of metadata
Go to start of metadata

Behavior of MultiSite and i18n with different I18nContentSupport implementations

Please see MULTISITE-86 - Getting issue details... STATUS . Tests were done with fix provided by the mentioned issue. Fix restores the behavior prior 5.6.1 including, where MULTISITE-80 - Getting issue details... STATUS introduced a bug, that breaks resolving of sites based on URIPrefix and locale (see also MULTISITE-90 - Getting issue details... STATUS for detailed explanation of the introduced bug).

Since MultiSite is also using site's I18nContentSupport for the site resolution, we have two places where we handle locales - MultiSiteFilter and I18nContentSupportFilter. Moreover we now always delegate locale resolution to respective sites, including CE version, using the SiteI18nContentSupport. Wouldn't be smarter to do the locale resolution as a part of site resolution and have the I18nContentSupportFilter disabled? To me, locale and site resolutions seems to be quite tight together. If users don't want to use SiteI18nContentSupport, they could switch to any other implementation they want and simply re-enable the I18nContentSupportFilter.

Questions:

  • What implications would updating the uri in the SiteMergeFilter / MultiSiteFilter had?
    • Is there any filter apart from cache that uses URI with locale?
      • CacheFilter wouldn't be affected because it's after I18nContentSupportFilter anyway.

Test environment

Magnolia EE Pro Demo 5.7.1 with MULTISITE-86 fix from PR applied.

Page hierarchy used for the test case (travel and sportstation demo sub pages are omitted):

Node name

 travel

 de

 en

 sportstation

 de

DefaultI18nContentSupport

This implementation resolves locale from URL (if present), or simply returns default locale. If locale is present in URL, it is also stripped by the I18nContentSupportFilter later in the filter chain (after MultiSiteFilter).

defaultExtension=html

No additional site setup

/de variations

(tick) Page /de can be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/de fallbackdeempty stringError page (404)
/de/fallbackde/Redirect to /travel (EN version) due to VirtualUri
/de.htmlfallbackdefault/de.htmlThe /de page is displayed.

/en/de

fallbacken/deThe /de page is displayed in EN version.

/en/de/

fallbacken/de/The /de page is displayed in EN version.

/en/de.html

fallbacken/de.htmlThe /de page is displayed in EN version.

/de/de

fallbackde/deThe /de page is displayed in DE version.

/de/de/

fallbackde/de/The /de page is displayed in DE version.

/de/de.html

fallbackde/de.htmlThe /de page is displayed in DE version.
/travel/de variations

(tick) Page /travel/de can be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public

/travel/de

traveldeempty stringThe /travel page is displayed in DE version.
/travel/de/travelde/The /travel page is displayed in DE version.
/travel/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/travel/en/detravelen/deThe /travel/de page is displayed in EN version.
/travel/en/de/travelen/de/The /travel/de page is displayed in EN version.
/travel/en/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/travel/de/detravelde/deThe /travel/de page is displayed in DE version.
/travel/de/de/travelde/de/The /travel/de page is displayed in DE version.
/trave/de/de.htmltravelde/de.htmlThe /travel/de page is displayed in DE version.
/travel/en variations

(tick) Page /travel/en can be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public

/travel/en

travelenempty stringThe /travel page is displayed in EN version.
/travel/en/travelen/The /travel page is displayed in EN version.
/travel/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/travel/en/entravelen/enThe /travel/en page is displayed in EN version.
/travel/en/en/travelen/en/The /travel/en page is displayed in EN version.
/travel/en/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/travel/de/entravelde/enThe /travel/en page is displayed in DE version.
/travel/de/en/travelde/en/The /travel/en page is displayed in DE version.
/travel/de/en.htmltravelde/en.htmlThe /travel/en page is displayed in DE version.

Additional site setup

correct domain setup for travel site on both author and public

/de variations

Page is not accessible on public.

(error) Page Editor opens /travel/de for edit.

/travel/de variations

(tick) Page /travel/de can be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/de traveldeempty stringThe /travel page is displayed in DE version.
/de/ travelde/The /travel page is displayed in DE version.
/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/en/detravelen/deThe /travel/de page is displayed in EN version.
/en/de/travelen/de/The /travel/de page is displayed in EN version.
/en/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/de/detravelde/deThe /travel/de page is displayed in DE version.
/de/de/travelde/de/The /travel/de page is displayed in DE version.
/de/de.htmltravelde/de.htmlThe /travel/de page is displayed in DE version.
/travel/en variations

(tick) Page /travel/en can be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/en travelenempty stringThe /travel page is displayed in EN version.
/en/ travelen/The /travel page is displayed in EN version.
/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/en/entravelen/enThe /travel/en page is displayed in EN version.
/en/en/travelen/en/The /travel/en page is displayed in EN version.
/en/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/de/entravelde/enThe /travel/en page is displayed in DE version.
/de/en/travelde/en/The /travel/en page is displayed in DE version.
/de/en.htmltravelde/en.htmlThe /travel/en page is displayed in DE version.

defaultExtension set to empty string

Difference is just in link generation. Links to pages does not contain any extension.

No additional site setup

/de variations

(error) The /de page cannot be edited using Page Editor.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/de fallbackdeempty stringError page (404)
/de/fallbackde/Redirect to /travel (EN version) due to VirtualUri
/de.htmlfallbackdefault/de.htmlThe /de page is displayed.

/en/de

fallbacken/deThe /de page is displayed in EN version.

/en/de/

fallbacken/de/The /de page is displayed in EN version.

/en/de.html

fallbacken/de.htmlThe /de page is displayed in EN version.

/de/de

fallbackde/deThe /de page is displayed in DE version.

/de/de/

fallbackde/de/The /de page is displayed in DE version.

/de/de.html

fallbackde/de.htmlThe /de page is displayed in DE version.
/travel/de variations

(error) The /travel/de page cannot be edited, /travel in DE version is shown instead. Page editor is however showing "English" in page language selector.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public

/travel/de

traveldeempty stringThe /travel page is displayed in DE version.
/travel/de/travelde/The /travel page is displayed in DE version.
/travel/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/travel/en/detravelen/deThe /travel/de page is displayed in EN version.
/travel/en/de/travelen/de/The /travel/de page is displayed in EN version.
/travel/en/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/travel/de/detravelde/deThe /travel/de page is displayed in DE version.
/travel/de/de/travelde/de/The /travel/de page is displayed in DE version.
/trave/de/de.htmltravelde/de.htmlThe /travel/de page is displayed in DE version.
/travel/en variations

(error) The /travel/en page cannot be edited, /travel in EN version is shown instead.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public

/travel/en

travelenempty stringThe /travel page is displayed in EN version.
/travel/en/travelen/The /travel page is displayed in EN version.
/travel/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/travel/en/entravelen/enThe /travel/en page is displayed in EN version.
/travel/en/en/travelen/en/The /travel/en page is displayed in EN version.
/travel/en/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/travel/de/entravelde/enThe /travel/en page is displayed in DE version.
/travel/de/en/travelde/en/The /travel/en page is displayed in DE version.
/travel/de/en.htmltravelde/en.htmlThe /travel/en page is displayed in DE version.

Additional site setup

correct domain setup for travel site on both author and public

/de variations

Page is not accessible on public.

(error) Page Editor opens /travel for edit in DE language. Page editor is however showing "English" in page language selector.

/travel/de variations

(error) The /travel/de page cannot be edited, /travel in DE version is shown instead. Page editor is however showing "English" in page language selector.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/de traveldeempty stringThe /travel page is displayed in DE version.
/de/ travelde/The /travel page is displayed in DE version.
/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/en/detravelen/deThe /travel/de page is displayed in EN version.
/en/de/travelen/de/The /travel/de page is displayed in EN version.
/en/de.htmltravelen/de.htmlThe /travel/de page is displayed in EN version.
/de/detravelde/deThe /travel/de page is displayed in DE version.
/de/de/travelde/de/The /travel/de page is displayed in DE version.
/de/de.htmltravelde/de.htmlThe /travel/de page is displayed in DE version.
/travel/en variations

(error) The /travel/en page cannot be edited, /travel in EN version is shown instead.

URI (http://localhost:8080/magnoliaPublic)Matched SiteLocale resolved by I18nContentSupportCleaned URI by I18nContentSupportResult on Public
/en travelenempty stringThe /travel page is displayed in EN version.
/en/ travelen/The /travel page is displayed in EN version.
/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/en/entravelen/enThe /travel/en page is displayed in EN version.
/en/en/travelen/en/The /travel/en page is displayed in EN version.
/en/en.htmltravelen/en.htmlThe /travel/en page is displayed in EN version.
/de/entravelde/enThe /travel/en page is displayed in DE version.
/de/en/travelde/en/The /travel/en page is displayed in DE version.
/de/en.htmltravelde/en.htmlThe /travel/en page is displayed in DE version.
  • No labels

3 Comments

  1. Regarding the intro information:
    "Moreover we now always delegate locale resolution to respective sites, including CE version, using the SiteI18nContentSuppor"
    I think its also important to look at the  MultiSiteI18nAuthoringSupport within this topic/analysis. Also the  MultiSiteI18nAuthoringSupport is closely bound to the site defintion's i18n locales, which I think is wrong!

    I have written about it (MultiSiteI18nAuthoringSupport) in MULTISITE-90 within a comment:

    From Jaro:
    "Not really, you can use fallback site with some default i18n settings to be always applied, if no site matches. If i18n#enabled=false on fallback, you wouldn't be able to edit language specific versions in content apps."

    From Christian:
    "I think here is the main problem a (historically grown) wrong concept of the close coupling of the content apps i18n behavior and the fallback site defintion. Out of my view this is even a 'mini bug'.

    -> site definitions are for defining a website's behavior. Also the fallback site definition. That's also why its called SITE definition . One can have various website with various site definitions serving different sets of languages (real multisite and not like the demo), but all of them retrieving content from the same content app (for example assets). So in the end the content app 'assets' would need to provide ALL existing locals defined in all exiting site definition. The close coupling that content apps allow only the locales defined in the 'fallback' definition forces you to define in the 'fallback' ALL possible locals of ALL existing site definitions, which is wrong behavior out of my view.

    I think content apps should react to a system value and not to a specific (or fallback) site definition:
    For all content apps -> 'config:/server/i18n/authoring/locales'
    For the websites -> their site defintion/i18n/locales

     

    Like this it would also be very easy to understand:
    'config:/server/i18n/authoring/locales' -> defines system wide what content can be entered in content apps (and implicit all websites as total summ)
    'specific site defintion/i18n/locales' -> defines for a specific website and implicit overrides for this website the config:/server/i18n/authoring/locales value
    'fallback site defintion/i18n/locales' -> defines for all websites not having a specific site defintion and implicit overrides the config:/server/i18n/authoring/locales value

    One could define: if the site defintion does not define any locales at all the ''config:/server/i18n/authoring/locales'' is used as fallback value for the authoring locales -> the same for all content apps and websites."

    In general I think it should be re-concepted in which case a local is taken. Its a big difference between detecting it for rendering website pages and form using content apps within AdminCentral:

    • SiteI18nContentSuppor"
    • MultiSiteI18nAuthoringSupport 
  2. Question form Jaro"
    "Is there any filter apart from cache that uses URI with locale?"

    yes the i18n filter to detect the locale. But I guess you know that and wanted to ask "besides the i18n filter" (smile)

  3. General about "additional site setup" and "correct domain setup for travel site on both author and public" in this analysis:

    1. There is always a site defintion in use, even in CE

    Generally about the URL analysis:

    A main point which deifnes how the local in the URL's is interpreted is the site defintion's property:
    siteDef
         i18n
            enabled=true||false

    Which means:

    • i18n enabled=true  => /de/ is just a flag but not a page, set local and remove it form currentURI
    • i18n enabled=false => /de/ is a flag and a page, set local and don't remove it form currentUR


    In the analysts above for me its not clear what is meant with:
     "additional site setup" and "correct domain setup for travel site on both author and public

    => One could have a site defintion without a configured domain, but having i18n enabled=true||false set. And the other way around.
    For me its not possible to determine if the results described above are correct or not if not differentiating in the site definition's configuration between 1. having/not having a domain mapping AND 2. i18n enabled=true||false.