Skip to content

🧭 docs: Sync Translated Sidebars With the English Pages - #859

Merged
berry-13 merged 4 commits into
mainfrom
berry-13/docs-locale-sidebar-sync
Oct 23, 2026
Merged

berry-13 merged 4 commits into
mainfrom
berry-13/docs-locale-sidebar-sync

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Summary

The translated sidebars (meta.<locale>.json) had drifted from the English ones, so 15 pages, including Settings, Composer, Scheduled Chats, Passkeys and Theme, were missing from the navigation in all 13 locales. This adds scripts/sync-locale-meta.mjs, which rebuilds each translated page list from English while keeping the translated separators and link labels, plus a check:locale-meta CI step so the lists cannot drift again.

It also regroups the configuration sidebar: RAG API moves under Services, Meilisearch under Infrastructure, and the UI group becomes Administration.

First of a 9-PR stack from a source audit of the docs against LibreChat dev; merge from the bottom up.

Change Type

  • Documentation update
  • CI / tooling

Testing

  • pnpm check:locale-meta passes; run against main, it flags all 91 translated sidebars this PR rewrites
  • New unit tests in scripts/sync-locale-meta.test.mjs; vitest run scripts/ 178/178
  • Every sidebar slug in every locale resolves to a page
  • ESLint and Prettier clean on the new script and test

Checklist

  • No dash punctuation added
  • Generated locale content is untouched apart from the sidebar files

The translated meta.<locale>.json files had drifted from the English
sidebars, so 15 pages were missing from the navigation in all 13
locales. Add scripts/sync-locale-meta.mjs to rebuild each translated page
list from English while keeping translated separators and link labels,
and a check:locale-meta CI step so they cannot drift again.

Also regroup the configuration sidebar: RAG API moves under Services,
Meilisearch under Infrastructure, and the UI group becomes
Administration.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
librechat-ai Ready Ready Preview Oct 23, 2026 3:53pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T15:49:13.196232Z 49f8f7c New commits
🔒 Security Review ✅ Completed 2026-10-23T15:19:39.866745Z 47fd9e7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47fd9e7c4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/sync-locale-meta.mjs Outdated

return englishPages.map((entry) => {
if (SEPARATOR_PATTERN.test(entry)) {
const translated = reuseSeparators ? localeSeparators[separatorIndex] : undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match translated separators to their sections, not their ordinal

When English sections are reordered, or one separator is removed while another is added so the total count stays unchanged, reuseSeparators remains true and the old translations are assigned solely by index. For example, swapping the English “Services” and “Infrastructure” sections leaves their localized headings in the old order above the wrong pages, and --check still passes because it reproduces the same incorrect mapping. Associate separators with the pages in their section, or fall back to English unless the section structure itself still matches.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 54d901b and 447f0d3: each translated separator now goes to the English section it shares the most pages with, strongest overlap first, and falls back to English when no section matches. New tests cover swapped and split sections.

Separators were reused by position whenever the section count matched,
so reordering or regrouping English sections left translated headings
above the wrong pages while the check still passed. Reuse each
translated separator for the English section that shares the most pages
with it, and keep the English label when no section matches.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Matching sections in English order let a newly split section take the
heading of the section that kept most of the original pages.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 447f0d3a1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/sync-locale-meta.mjs
Comment thread scripts/sync-locale-meta.mjs Outdated
Comment on lines +111 to +113
const localeFiles = (await readdir(dir)).filter((name) => LOCALE_META_PATTERN.test(name))

for (const name of localeFiles) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify that every locale metadata file exists

When a meta.<locale>.json file is deleted, or a new metadata directory is added without files for every configured locale, this loop only processes the files that happen to exist and --check still reports that all translated sidebars match. The affected locale then falls back to the English metadata and loses its localized title and separators, so the CI check should compare the discovered files against the configured non-default locales (or another complete expected set) before validating their contents.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 49f8f7c: the check now expects every locale used in any sidebar folder, reports a missing file, and --write creates it from English. New test covers a folder without translations.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

The check only validated locale files that existed, so a deleted file or
a new folder without translations passed. Expect every locale used in any
sidebar folder, and create missing files from English in write mode.
Document that renamed headings keep their old translation.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@berry-13
berry-13 added this pull request to stack #869 October 23, 2026 16:25
@berry-13
berry-13 merged commit 1260e64 into main Oct 23, 2026
5 checks passed
@berry-13
berry-13 deleted the berry-13/docs-locale-sidebar-sync branch October 23, 2026 19:36

This branch was successfully deployed

1 active deployment
Preview — 49f8f7c6 Deployed Oct 23, 2026 by vercel[bot]
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.

1 participant