Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting localized strings cause mixed up values for title and sidebar labels #916

Closed
notlmn opened this issue Aug 26, 2018 · 0 comments 路 Fixed by #917
Closed

Conflicting localized strings cause mixed up values for title and sidebar labels #916

notlmn opened this issue Aug 26, 2018 · 0 comments 路 Fixed by #917
Assignees
Labels
status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@notlmn
Copy link
Contributor

notlmn commented Aug 26, 2018

馃悰 Bug Report

Docusaurus uses the same object to have localized strings of both title and sidebar_label of a page, using id as key that maps to title of that page. This is fine in most cases, but if the id and sidebar_label of a page are the same then the keys conflict, causing both of them to mix up.

This leads to behavior like #324. This gets even weirder when the same values are used across different versions of the docs, where the sidebar_label of the versioned doc gets mixed up with the title of latest doc.

Have you read the Contributing Guidelines on issues?

Yes I did.

To Reproduce

  1. Choose a value for id for a page
  2. Use the same value of id for sidebar_label as well
  3. Use a title that is not the same as id or sidebar_label

Expected behavior

The title of the page and label on the sidebar are expected to be different.

Actual Behavior

The title of the page is the value of sidebar label instead of its actual one.

Reproducible Demo

Sample repo that contains same values for id and sidebar_label, with a different title, and across different versions.

After building the docs and running docusaurus-start, navigate to /docs/en/feature-awesome. Here the sidebar label should be feature-awesome, instead it is feature/awesome which is the title of latest doc with the same.

Proposed solution

Use different keys for titles, sidebar_labels, across different versions of the same page.

{
  "localized-strings": {
    "versioned-page-id": {
      "title": "",
      "sidebar_label": ""
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants