public class HierarchyBasedI18nContentSupport extends AbstractI18nContentSupport
+my-website + en + page-1 + page-2 + page-n + de + page-1 + page-2 + page-n + de_CH + page-1 + page-2 + page-n + it + page-1 + page-2 + page-nThe locale is inferred by analyzing the URI and checking whether it contains a valid Java locale code (see definition of valid Java locale code). This code can be at whatever position in the URI, not necessarily the first one. For example, given the following URI /my-website/node-1/node-2/de/home-page.html, the locale de will be detected and content served from here:
+ my-website + node-1 + node-2 + de + home-pageAlso the last element in the URI, typically a page, can be used to determine the locale. E.g. given the URI /foo/bar/it.html a it locale will be determined. If no locale is found in the URI, the default one is assumed.
defaultLocale
Constructor and Description |
---|
HierarchyBasedI18nContentSupport() |
Modifier and Type | Method and Description |
---|---|
protected Locale |
onDetermineLocale() |
protected String |
toI18NURI(String uri,
Locale locale) |
protected String |
toRawURI(String i18nURI,
Locale locale) |
addLocale, determineLocale, determineLocalFromString, getDefaultLocale, getFallbackLocale, getLocale, getLocales, getNextContentLocale, getNextLocale, getNode, getProperty, getProperty, hasProperty, isEmpty, isEnabled, isLocaleSupported, setDefaultLocale, setEnabled, setFallbackLocale, setLocale, setLocales, toI18NURI, toRawURI
protected Locale onDetermineLocale()
onDetermineLocale
in class AbstractI18nContentSupport
protected String toI18NURI(String uri, Locale locale)
toI18NURI
in class AbstractI18nContentSupport
protected String toRawURI(String i18nURI, Locale locale)
toRawURI
in class AbstractI18nContentSupport
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.