Handle unavailable languages and selector fallbacks

A selector starts from the site's enabled locales, then removes entries that are unavailable in the current context or disabled by the surface configuration.

Excluded content

When the current post or term is excluded from a locale, that locale is removed before selector entries are built. The selector therefore does not advertise a destination that POM Translate intentionally serves as a 404.

This is different from an incomplete translation. Missing text or a missing localized slug can still use source-language fallback, so that locale may remain selectable.

Base and current language filters

  • The shortcode can set include_base_language="false".
  • A navigation switcher has Include base language in the list.
  • Floating output includes the base locale.
  • The global Hide current language policy removes the active locale unless a shortcode explicitly includes it.

Filters are cumulative. A base locale that is also current can be removed by either relevant decision.

URL fallback

Every remaining entry is built from the current route's base path. Post and term segments use the localized slug when available and fall back to their source route values when necessary. Query strings and trailing-slash style are preserved.

The selector does not create translated content. It only builds the available route for each locale.

Empty output

If filtering leaves no language entry, POM Translate returns no markup. A navigation placeholder can therefore disappear, a shortcode can render nothing, or floating output can be omitted.

Before launch, test:

  1. content available in every locale;
  2. a post excluded from one locale;
  3. a term excluded from several locales;
  4. the current language hidden;
  5. the base language omitted;
  6. a route with incomplete localized slugs.