Skip to content

i18n should not assume 1-1 matching between translated locale routes #7041

Description

@yzeng25

Have you read the Contributing Guidelines on issues?

Motivation

Hi,

First of all I want to thank you all for providing such an awesome open-source tool. I've been using it for 2.5 years in different companies, Docusaurus has been stable and extremely easy to use and maintain.

I started using the i18n feature to implement multi-language blogs about half year ago. It works fine since then. But as our team grows and kind of diverges, we figure out that simply putting blogs in two languages is barely enough. Then we are discussing about publishing blogs in 2 languages, English and Chinese, separately.

So then I tried to verify the feasibility of this thought, and it kind of failed from several aspects.

Case 1: Publish an English blog only. Everything works well (i.e. yarn start local preview, online previews), except when clicking on the language switch button and redirects to the default 404 response page.

Case 2: Publish a Chinese blog only. This is where the nightmares come in. The yarn start -- --locale zh local preview works. But when generating online preview, this somewhat becomes a 'ghost page'. More specific, this page is unreachable by any means.

Then I went through Docusaurus's documents and learned some basic ideas about it. The i18n feature works when the 1-to-1 relationship is established for a blog in 2 languages, which totally makes sense in most cases. But when we need blogs only presented in one language, it partially failed.

So I am wondering if there is a work-around to this issue, or some kinds of feature flags/vars that I could use to avoid it? I know this is a very rare corner-case, and this might be too much to ask for, but could you consider fixing it in future releases?

Thanks,
Yilin

Self-service

  • I'd be willing to do some initial work on this proposal myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: i18nRelated to the i18n systemproposalThis issue is a proposal, usually non-trivial change

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions