[Docs]: fix 404 on language switch on docs page#19979
[Docs]: fix 404 on language switch on docs page#19979rajmohan-14 wants to merge 1 commit intotwentyhq:mainfrom
Conversation
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
There was a problem hiding this comment.
Pull request overview
Updates Mintlify navigation to avoid 404s when switching the docs site language to French or Arabic by temporarily routing the “Getting Started” section to the existing English pages.
Changes:
- For
fr, replacedl/fr/getting-started/**navigation entries withgetting-started/**within the “Getting Started” tab. - For
ar, replacedl/ar/getting-started/**navigation entries withgetting-started/**within the “Getting Started” tab.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "group": "Welcome", | ||
| "pages": [ | ||
| "l/fr/getting-started/introduction", | ||
| "l/fr/getting-started/key-features", | ||
| "l/fr/getting-started/quickstart" | ||
| "getting-started/introduction", | ||
| "getting-started/key-features", | ||
| "getting-started/quickstart" |
There was a problem hiding this comment.
docs.json navigation is generated (see packages/twenty-docs/scripts/generate-docs-json.ts which prefixes every non-default-language slug with l/<lang>/...). These manual slug changes will be reverted the next time yarn docs:generate runs (including the docs i18n workflows), reintroducing the 404. Consider implementing the fallback in the generator (e.g., only prefix when the localized MDX exists, otherwise keep the base English slug) and then regenerating docs.json.
| "getting-started/core-concepts/data-model", | ||
| "getting-started/core-concepts/layout", | ||
| "getting-started/core-concepts/workflows", | ||
| "getting-started/core-concepts/calendar-and-email", | ||
| "getting-started/core-concepts/ai", | ||
| "getting-started/core-concepts/apps", | ||
| "getting-started/core-concepts/dashboards", | ||
| "getting-started/core-concepts/glossary" |
There was a problem hiding this comment.
This change only updates the Getting Started slugs for fr and ar, but docs.json still lists l/<lang>/getting-started/... for other supported languages (cs, de, es, etc.) even though there is no packages/twenty-docs/l/<lang>/getting-started/ content. Switching to those languages will likely still land on a 404. If the intent is to fix language switching globally (per the linked issue/title), apply the same fallback for all locales (or handle it centrally in the generator).
Summary
Switching the Mintlify docs site (docs.twenty.com) to French (fr) or Arabic (ar) currently redirects to a 404. This happens because the
packages/twenty-docs/docs.jsonnavigation referencesl/fr/getting-started/...andl/ar/getting-started/...pages that do not exist yet.This PR updates the Getting Started tab for fr and ar to temporarily point to the existing English pages under
getting-started/..., so switching to these languages no longer results in a broken landing page.What changed
packages/twenty-docs/docs.jsonfr): Replacedl/fr/getting-started/...withgetting-started/...only inside the Getting Started tab.ar): Replacedl/ar/getting-started/...withgetting-started/...only inside the Getting Started tab.l/fr/user-guide/...,l/ar/user-guide/...,l/<lang>/developers/...), includingl/<lang>/developers/extend/apps/getting-startedwhich is a different page and remains valid.Why
Mintlify loads the first page of the selected language’s navigation when switching languages. Since
l/fr/getting-started/introductionandl/ar/getting-started/introduction(and the rest of that section) aren’t present, users hit a 404. Showing the Getting Started section in English is preferable to a broken docs experience until translations are available.User impact
Testing
Follow-up
l/fr/getting-started/**andl/ar/getting-started/**content is created by the translation pipeline, updatedocs.jsonto point back to the translated paths.Related
Fixes #19971