Skip to content

[Docs]: fix 404 on language switch on docs page#19979

Open
rajmohan-14 wants to merge 1 commit intotwentyhq:mainfrom
rajmohan-14:fix/404-issue-on-language-switch-on-doc
Open

[Docs]: fix 404 on language switch on docs page#19979
rajmohan-14 wants to merge 1 commit intotwentyhq:mainfrom
rajmohan-14:fix/404-issue-on-language-switch-on-doc

Conversation

@rajmohan-14
Copy link
Copy Markdown

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.json navigation references l/fr/getting-started/... and l/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

  • File: packages/twenty-docs/docs.json
  • French (fr): Replaced l/fr/getting-started/... with getting-started/... only inside the Getting Started tab.
  • Arabic (ar): Replaced l/ar/getting-started/... with getting-started/... only inside the Getting Started tab.
  • Left other translated paths untouched (e.g. l/fr/user-guide/..., l/ar/user-guide/..., l/<lang>/developers/...), including l/<lang>/developers/extend/apps/getting-started which 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/introduction and l/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

  • Users can switch to French or Arabic without landing on a 404.
  • The Getting Started section will appear in English for fr and ar until translated files are added.

Testing

  • Switched language to fr and ar and verified the docs no longer redirect to a 404.
  • Verified other translated sections continue to resolve correctly.

Follow-up

  • Once translated l/fr/getting-started/** and l/ar/getting-started/** content is created by the translation pipeline, update docs.json to point back to the translated paths.

Related

Fixes #19971

Copilot AI review requested due to automatic review settings April 22, 2026 13:54
@github-actions
Copy link
Copy Markdown
Contributor

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against 002afbc

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, replaced l/fr/getting-started/** navigation entries with getting-started/** within the “Getting Started” tab.
  • For ar, replaced l/ar/getting-started/** navigation entries with getting-started/** within the “Getting Started” tab.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 424 to +429
{
"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"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +435 to +442
"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"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs]: Switching to any language redirects to a 404 page

2 participants