Skip to content

RFC: Support i18n locale-specific content ? #11076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
slorber opened this issue Apr 8, 2025 · 1 comment
Open

RFC: Support i18n locale-specific content ? #11076

slorber opened this issue Apr 8, 2025 · 1 comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@slorber
Copy link
Collaborator

slorber commented Apr 8, 2025

Description

Many users requested the ability to create i18n locale-specific content.

By that, I mean localized sites are mostly the same and share many pages, apart from a few exceptions like

  • /en/docs/english-only-doc: this page only exists for the en locale
  • /fr/docs/french-only-doc: this page only exists for the fr locale

One problem is that Docusaurus assumes that all localized sites have the same structure as the default locale. Things such as the language fallback and the i18n SEO (hreflang meta headers) and UX (ability to switch locale while staying on the same page) rely on this assumption.


In this RFC, I'd like to open the discussion with the community to see what can be done to make your life easier without breaking that assumption that would break features that other users like.

Recent issues discussing this topic:

API design

One possibility could be to create an API that enables users to provide front matter such as pages that do not exist in a given locale are still created but automatically redirected to another page.

This is a behavior implemented here: #11001 (comment)

The page /fr/docs/english-only-docs could automatically redirect to the root /fr/ for example, or any other URL provided by the user.

@slorber slorber added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers and removed status: needs triage This issue has not been triaged by maintainers labels Apr 8, 2025
@hussfelt
Copy link

hussfelt commented Apr 8, 2025

Partial from my comment here.

I like this approach. A 301 to a specific page that explains it is not relevant, but it would lower the end user experience if they accidentally traverse and navigate the documentation and then suddenly arrive somewhere else in the tree. Simply "This article is not relevant to your language" could be it. Or maybe marking it as "Market specific" right from the start.

I actually like the approach you take here and the stance that Docusaurus has. I'd like to circle back and discuss this internally.
That said; the neatest feature that we would "like" is the same thing as marking a document as draft, make it available on only certain languages - but I totally see that it would break everything else; so I do not propose such a wide change for the project.

The best thing would be for me to convince the team that "if an article is not intended for a market or a language we show this banner at the top". Meaning localised partial content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

2 participants