Paired locales as nodes in API response, when querying for documents with localization enabled #1172
quornik
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature idea & request: An ability to determine if the document I'm fetching, has it's corresponding siblings in other locales.
This way, while doing the language switch on frontend, it would be much easier to create link the switch is pointing to. If for example, page we are currently on doesn't have its siblings, lang switch should point user to homepage (in example). IF it does have one, switching language should point user to the corresponding document.
in nextjs, language switch can look similar to this:
In case above, everything works fine if every page has its matching sibling. If not, 404. To avoid that, we should have simple way to determine if the article has its multilingual siblings.
In some other CMS solutions with localization options, it is often a good practice that document request returns a field (or fields) with the information of localization status.
Beta Was this translation helpful? Give feedback.
All reactions