Skip to content

fix(docs): generated-index link translations use category.label instead of category.key for lookup #11738

Closed

Description

@akshatsinha0

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

getSidebarTranslationFileContent in packages/docusaurus-plugin-content-docs/src/translations.ts
generates translation keys for category generated-index links using category.key ?? category.label
(lines 96, 109, 118).

But transformSidebarCategoryLink in the same file looks up those translations using only
category.label (lines 182, 186), ignoring the key attribute entirely.

Line 200 in the same translateSidebar function already correctly uses item.key ?? item.label for
category label lookups. Same for links (line 210) and docs (line 219). Only
transformSidebarCategoryLink was missed.

Related: #8118

Reproducible demo

No response

Steps to reproduce

  1. Create a sidebar category with a custom key attribute in _category_.json
  2. Give that category a generated-index link with a title and description
  3. Run docusaurus write-translations to generate the translation file
  4. Translate the generated-index title and description entries in the translation file
  5. Build the site with the target locale

Expected behavior

The generated-index page title and description resolve from the translation file using the key sidebar <name>.category.<key>.link.generated-index.title.

Actual behavior

The generated-index page title and description remain untranslated because transformSidebarCategoryLink looks up sidebar.<name>.category.<label>.link.generated-index.title while the translation file contains sidebar.<name>.category.<key>.link.generated-index.title.

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.

Activity

  1. added
    bug
    status: needs triage
    on Feb 13, 2026
  2. akshatsinha0 commented on Feb 13, 2026

    @akshatsinha0
    ContributorAuthor
  3. akshatsinha0 commented on Feb 14, 2026

    @akshatsinha0
    ContributorAuthor

    @Solix45456767 , May I ask you to rethink what you are asking?

  4. added a commit that references this issue on Feb 14, 2026
    5769fe5
  5. removed
    status: needs triage
    on Feb 19, 2026
  6. added a commit that references this issue on Feb 19, 2026
    a8881ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions