Correct a language-selector destination
The selector resolves the current route to its base path and rebuilds the equivalent URL for each locale. A wrong link usually points to incorrect slug data, an unresolved custom route, or stale cached markup.
Compare routes
- Record the current base and target URLs.
- Check the locale prefix and base-language prefix policy.
- For a post or term, verify every localized parent and current slug.
- For a custom internal URL, verify its registered target mapping.
- Confirm query strings, fragments, pagination, and WooCommerce endpoint values are preserved.
- Clear menu, page, object, and CDN caches.
Test the generated link directly. If it returns 404, resolve routing first rather than editing selector markup.
Identify unsupported destinations
External URLs are intentionally left unchanged. Browser-only routes and third-party endpoints may require a maintained custom URL or routing integration. A selector cannot invent the equivalent page on an external service.
If custom code filters pom_translate_language_switcher_html, disable that callback and compare the default result. Rebuilding links in the final HTML filter can discard the localized hierarchy and exclusions calculated by POM Translate.
The fixed selector should produce one stable equivalent route per available locale, preserve URL components, and mark the current language accurately.