Repository navigation
🧭 docs: Sync Translated Sidebars With the English Pages - #859
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
|
|
||
| return englishPages.map((entry) => { | ||
| if (SEPARATOR_PATTERN.test(entry)) { | ||
| const translated = reuseSeparators ? localeSeparators[separatorIndex] : undefined |
There was a problem hiding this comment.
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 👍 / 👎.
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.
📦 Next.js Bundle Analysis for librechat.aiThis 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.
There was a problem hiding this comment.
💡 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".
| const localeFiles = (await readdir(dir)).filter((name) => LOCALE_META_PATTERN.test(name)) | ||
|
|
||
| for (const name of localeFiles) { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
📦 Next.js Bundle Analysis for librechat.aiThis 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.
📦 Next.js Bundle Analysis for librechat.aiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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 addsscripts/sync-locale-meta.mjs, which rebuilds each translated page list from English while keeping the translated separators and link labels, plus acheck:locale-metaCI 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
Testing
pnpm check:locale-metapasses; run againstmain, it flags all 91 translated sidebars this PR rewritesscripts/sync-locale-meta.test.mjs;vitest run scripts/178/178Checklist