@ProviderType
public interface LanguageAlternativesService
Page
's language alternatives.Modifier and Type | Method and Description |
---|---|
@Nullable Page |
getLanguageAlternative(@NotNull Page page,
@NotNull java.util.Locale locale)
Returns the language alternative of a given
Page in the given Locale . |
@NotNull java.util.Map<java.util.Locale,Page> |
getLanguageAlternatives(@NotNull Page page)
Traverses the site subtree of the given
Page using depth-first-search up to a configured maximum depth and returns language
alternatives of the given page in each of the found language roots in the subtree. |
Page |
getSiteRoot(Page page)
Returns the site root as returned by the highest ranked
SiteRootSelectionStrategy for the given Page . |
Page getSiteRoot(Page page)
SiteRootSelectionStrategy
for the given Page
.page
- the given Page
null
if not found@Nullable @Nullable Page getLanguageAlternative(@NotNull @NotNull Page page, @NotNull @NotNull java.util.Locale locale)
Page
in the given Locale
.
This is an optimised implementation of
languageAlternativesService.getLanguageAlternative(page).get(locale);
@NotNull @NotNull java.util.Map<java.util.Locale,Page> getLanguageAlternatives(@NotNull @NotNull Page page)
Page
using depth-first-search up to a configured maximum depth and returns language
alternatives of the given page in each of the found language roots in the subtree. Language roots that are ancestors of other
language roots are skipped. For example /content/wknd/fr/fr
is taking precedence over /content/wknd/fr
for which
Locale
derived from the path would be the same.
The Page
's site root is defined by an implementation of SiteRootSelectionStrategy.getSiteRoot(Page)
.
Copyright © 2010 - 2023 Adobe. All Rights Reserved