Contentful logo

Contentful Community

Search in all locales


I have urls on my app that look like this<locale>/<entry_slug>
To build a page, I use contentful API to search for an entry with slug=<entry_slug>

I’d like to enable localization for the slug field so an entry could look like:

{slug:{ en: 'mySlug-en', fr: 'mySlug-fr' }

Now let’s say the user is on page:

My issue is that if the user changes the locale to let’s say french, then the language switch will navigate to:

But mySlug-en won’t match any entry for locale fr.

If contentful API could search for slug=mySlug-en in any locale then I could get my content and redirect the user to