We have a mutli-language website we are currently building and we have slugs in multiple languages (en-US, en-DE and de-DE) I’m now looking for an API Query to pass which is basically looking for a matching slug in either of those languages (preferably the currently visited language first and afterwards the fallback). So basically I just want to apply the regular fallback logic also to the Query params. I tried various options but can’t find a solution to this problem, does any know if it’s possible?
Example set up: (en-US is the default and both en-DE and de-DE have en-US as the fallback)
- slug en-US: “english-article”
- slug en-DE: “”
- slug-de-DE: “german-article”
Now I want to use the de-DE slug to get to the sys.id:
^ The first one doesn’t work, but the second one does. So far so good.
What now happens though if I use the same logic with the locale en-DE is that it’s breaking because I specifically told it to look in the en-DE, but it’s empty. Now only the first one works.
So in theory I would love to have a logic like this: