Black Friday
Skip to documentation content

Multilingual Sites

Understand locale and language-navigation providers

Core separates locale resolution from navigation. Resolving the locale for an email, admin request or booking does not by itself provide a list of languages or a safe destination for switching the current page.

Core separates locale resolution from navigation. Resolving the locale for an email, admin request or booking does not by itself provide a list of languages or a safe destination for switching the current page.

Locale resolution

The public locale-provider interface is KimoraPro\HotelBooking\Internationalization\LanguageProviderInterface. Its methods are localeFor(string $context, ?string $requestedLocale = null): string and siteLocale(): string. Context and validated locale resolution remain Core responsibilities.

WordPress, configured multilingual adapters and validated extension filters participate in that layer. Pro delegates to Core rather than introducing a second competing global language system. Invalid/failing providers fall back safely instead of letting a theme set vendor globals.

Themes obtain KimoraPro\HotelBooking\Internationalization\LanguageNavigationInterface from kimorapro_hb()->languages(). This interface provides current/available/url/state/provider/snapshot, not a permission to mutate language or booking history.

An optional navigation provider uses LanguageNavigationProviderInterface with key(), available() and navigation(string $currentUrl). Core selects and normalizes its output, checks directions/current item and rejects unsafe URLs. Register extensions only through the documented provider filter and contract, not by replacing internal registries from a theme.

Preserve ownership

The theme renders the normalized items and hides unavailable/locked output. It must not load WPML/Polylang internals, query private booking repositories or transfer access-bearing query fields into links.

With native WordPress only, a single-language result is valid. Provider errors, missing translated destinations and sensitive routes can yield no switch link; inventing Home as a universal fallback does not preserve the intended surface.

Historical HB\... namespaces and the pre-rename facade are not current integration examples. Use the exact exported symbols in this reference and verify the active contract major before adopting extensions.

See navigation API and saved booking locales.

Was this article helpful?

Your feedback helps us improve the documentation.