Skip to documentation content

Troubleshooting

Troubleshoot language menus and routes

Diagnose missing custom links, incorrect locale switching and virtual-route redirects through the Core Language Navigation contract.

The Core Language Navigation facade supplies the current language, available languages and switch URLs; the theme only renders them. Check the provider state, normalized code, locale, label, url, current and switchable values before changing menu markup. A provider may preserve order, report single_language, unavailable, locked or provider_error, and the theme must render an honest state instead of inventing a URL.

Consume the public facade hotel_booking()->languages() and do not infer the current locale from a menu label.

When custom links disappear in a locale, open Appearance → Menus, select the correct language menu and verify the Custom Links target is a same-site HTTP(S) URL. Do not use http://rooms/, an empty host or a hard-coded English route. For rooms and search-availability, the public fallback helper preserves the current locale and query context. A switch from Booking or another sensitive payment/confirmation route is intentionally locked when no safe switch URL is available; it must not leak tokens, nonces or signatures.

Clear only the relevant page or object cache after correcting menu assignment, then test EN and VI (or the configured pair) from Home, Rooms and Booking. The booking snapshot locale is immutable, so a later menu switch cannot rewrite a historical confirmation. Themes must not call WPML or Polylang directly.

Was this article helpful?

Your feedback helps us improve the documentation.