Skip to content

i18n(ru): add Russian locale for documentation site - #70

Merged
CodFrm merged 7 commits into
scriptscat:mainfrom
Nikitamce:i18n/add-russian-locale
Jul 30, 2026
Merged

i18n(ru): add Russian locale for documentation site#70
CodFrm merged 7 commits into
scriptscat:mainfrom
Nikitamce:i18n/add-russian-locale

Conversation

@Nikitamce

Copy link
Copy Markdown
Contributor

Summary

Adds a full Russian (ru) locale to the ScriptCat documentation site (Docusaurus).

Changes

  • docusaurus.config.js: register ru / «Русский» next to zh-Hans and en
  • i18n/ru/code.json: homepage and product UI strings
  • i18n/ru/docusaurus-theme-classic/*: navbar & footer labels
  • i18n/ru/docusaurus-plugin-content-docs/: all current docs
    • User guide (install, open-dev, sync, VS Code, migrate from TM/VM, FAQ)
    • Policies (disclaimer, privacy)
    • Developer docs (API, background, meta, CloudCat, Agent suite)
    • Changelogs (v0.16–v1.5, main index, beta changelog)

Notes

  • Product names, API identifiers, code blocks, and URLs are kept as-is
  • Images are carried over from the English locale tree where needed

Test plan

  • pnpm i && pnpm start -- --locale ru
  • Language dropdown shows Русский
  • /ru/ homepage and navbar are in Russian
  • Spot-check /ru/docs/use/use/, /ru/docs/dev/, /ru/docs/change/
  • Build succeeds: pnpm build

Add full Russian (ru) Docusaurus locale:
- Enable ru in docusaurus.config.js locale dropdown
- Translate homepage/UI strings (code.json, navbar, footer)
- Translate user guide, developer docs (incl. Agent), policies
- Translate changelogs (stable + beta)
@CodFrm

CodFrm commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thank you very much, I will review it in a couple of days.

@CodFrm

CodFrm commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thanks for the Russian localization contribution! I’ve pushed a follow-up commit to address the issues found during review.

The main maintenance change is that Russian changelog pages now use the English changelog as their single source of truth. Updating i18n/en/.../change/*.md and rebuilding the site will automatically update the corresponding /ru/docs/change/... pages. The Russian URLs remain unchanged, and the pages will not fall back to Chinese.

The follow-up also:

  • fixes the broken Russian anchors and locale-aware links;
  • corrects the privacy-policy data-retention wording and the @connect permission semantics;
  • extends the i18n/frontmatter checks to cover all locales;
  • adds a production-output check to ensure the 9 Russian changelog pages continue to use the English source;
  • updates the URL inventory with the 49 new /ru/ routes;
  • localizes the Russian SEO metadata.

Validation completed successfully:

  • pnpm run typecheck
  • full production build for zh-Hans, en, and ru
  • pnpm run check (147 routes, 9 configured fallbacks, i18n parity, and frontmatter)
  • generated HTML checks for changelog content, links, anchors, privacy wording, and API permission wording

The PR is now clean and mergeable from my side.

@Nikitamce

Copy link
Copy Markdown
Contributor Author

thank you very much, If there’s anything else that needs to be added or fixed on my side, just let me know — I’ll correct or complete it so there are no issues.

CodFrm added 5 commits July 30, 2026 10:26
- Root 语言重定向改为按已配置的 locale 表驱动:俄语浏览器首次访问会跳到
  /ru/,并且不会再把 /ru/xxx 拼成 /en/ru/xxx 这种 404 路径
- 落地页导航、语言切换器、页脚、卸载页的站内链接补上带当前语言的 baseUrl;
  语言切换器的选项和标签直接取自 i18n.localeConfigs,以后加语言无需改代码
- 卸载页改用 currentLocale 判断语言,/ru/ 不再拿到中文 issue 模板
- 俄语文档改为引用英文截图,删掉 i18n/ru/ 下 21 个重复图片二进制(约 1 MB)
- 落地页两处示例代码块里的脚本名和通知文案改走 translate():兼容性卡片
  复用已有的 home.hero.mock.speed,编辑器卡片新增 home.dev.mock.name /
  home.dev.mock.toast(通知文案在代码行和控制台行复用同一个 key)
- 卸载页三个商店按钮改用 uninstall.reinstall.chrome/edge/firefox
- 顺带去掉 Firefox 商店链接里写死的 /zh-CN/ 路径段,交给 AMO 按浏览器
  语言自己跳
- 译文长度控制在示例代码原有最长行以内,不会把代码卡片撑开
把这次俄语 locale review 里踩到的坑固化成文档,避免以后重犯。放在
conventions/ 而不是 docs/,因为 docs/ 是发布目录,新增 md 会产生公开
路由并要求各 locale 镜像。

conventions/i18n.md 覆盖:
- 不要假设只有两种语言(判断语言用 currentLocale,遍历用 i18n.locales
  + localeConfigs,换前缀前先剥掉已有前缀)
- 原生 <a href="/..."> / antd Button href 必须补 withBaseUrl
- UI 文案一律走 <Translate>/translate(),en 与 ru 的 code.json 键序一致
- 外链不要写死 /zh-CN/ 这类语言路径段
- 示例代码块对行宽敏感,译文不能超过原有最长行
- 跨语言复用的锚点要写显式 {#id}
- 单一来源回退的作用范围是整棵树,漏译只会静默显示英文
- 新增 locale 的 10 步清单,以及 Algolia 爬虫需在后台同步
- 已知例外与待办(Algolia 未收录 /ru/、无 CI、HomepageFeatures 死代码、
  LINKS.search 有意保留中文关键词)

同时修正 CONTRIBUTING.md 两处不准确的说法:指向从未存在的
REFACTOR_PROPOSAL.md 的死链,以及两处"由 CI 校验"——仓库目前没有 CI,
检查只能本地手动跑。
- 新增根目录 AGENTS.md 作为 agent 入口:项目概览、命令、提交前必做、
  硬性约束(URL 契约、不要往 docs/ 放非文档 md)、目录结构、多语言要点、
  样式与依赖、约定文档索引
- conventions/ 改名 agents/,内容对 agent 的针对性更明确
- agents/i18n.md 补充:locale 假设不只在 src/ 里,还有
  docusaurus.config.js 的 metadataByLocale 和 nginx 的 404 分流;
  新增 locale 清单相应扩到 11 步

同时修两处此前遗漏/写错的:

- deploy/docker/nginx.conf 的 404 分流只认 /en/,导致 /ru/ 下的 404 会
  返回中文页面。构建产物里 build/ru/404.html 是存在的,只是 nginx 没路由
  过去;构建和 check 都发现不了这类问题,只有线上能看出来
- 回退上一个 commit 对 CONTRIBUTING.md 的错误改动:仓库**有** CI,在
  .gitea/workflows/ci.yaml(每个 PR 跑 typecheck + build + check,
  deploy 前再跑一次 build + check),原本"由 CI 校验"的说法是对的。
  GitHub 侧看不到状态是因为 CI 在 Gitea 上

另补 start:ru 脚本,与已有的 start:zh / start:en 对齐。
- AGENTS.md 全文改为英文,并注明 CONTRIBUTING.md 与 agents/i18n.md 是
  中文(顶部有英文摘要行)
- .gitignore 去掉 CLAUDE.md 一行,提交一个只含 @AGENTS.md 的 CLAUDE.md,
  这样克隆仓库即可自动读到 AGENTS.md(.claude 目录仍然忽略)
@CodFrm
CodFrm merged commit 55c95bc into scriptscat:main Jul 30, 2026
@CodFrm

CodFrm commented Jul 30, 2026

Copy link
Copy Markdown
Member

Thanks, I've merged it; it will be updated on the website very soon.

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.

2 participants