docs(i18n): add zh-CN translations for integrations, mascot, model-routing, privacy, and tools#2450
docs(i18n): add zh-CN translations for integrations, mascot, model-routing, privacy, and tools#2450JAYcodr wants to merge 16 commits into
Conversation
…ver panels Translate 25 previously-untranslated UI strings across workspace vault controls, appearance helper text, mascot settings, and MCP Server settings panel. Placeholder values (CPU/GPU/RAM), technical examples (localhost URLs, API key formats), and brand names (OpenHuman, Composio) remain in English.
…ver panels Translate 25 previously-untranslated UI strings across workspace vault controls, appearance helper text, mascot settings, and MCP Server settings panel. Placeholder values (CPU/GPU/RAM), technical examples (localhost URLs, API key formats), and brand names (OpenHuman, Composio) remain in English.
Replaced 保险库 with 存储库 across workspace vault strings to match existing workspace.viewVault translation.
Initial security audit covering: - Module map (66 domain modules) - Credential and token flows - Trust boundaries and attack surface - MCP server config file permissions - Prompt injection guard coverage - Recommended next steps for maintainers
…re docs - overview/getting-started.zh-CN.md - features/token-compression.zh-CN.md - features/platform.zh-CN.md - features/native-tools/README.zh-CN.md - features/native-tools/web-search.zh-CN.md - features/native-tools/web-scraper.zh-CN.md - features/native-tools/browser-and-computer.zh-CN.md
- Fix critical mistranslations: email thread, plugin-only model, user-facing, fair game for ingest, fold into memory tree, swallowed errors, dirtied topic tree - Unify terminology: vault → 知识库 (11 occurrences), tick → 触发周期 - Improve awkward/phrasing: 空着出场→空载交付, 运输工具→载体, 吞掉→静默处理, 工厂短路→Factory会跳过, 大声失败→明显报错, 激进→积极 - Add missing obsidian-wiki zh-CN translations to the commit
…ewlines - Add ```text language identifier to bare code blocks in memory-tree, auto-fetch, obsidian-wiki README - Add missing trailing newlines to all batch-a files - Retain http://localhost:3111 in agentmemory-backend (valid config default)
- features/privacy-and-security.zh-CN.md - features/integrations/README.zh-CN.md - features/mascot/README.zh-CN.md - features/model-routing/README.zh-CN.md - features/native-tools/coder.zh-CN.md - features/native-tools/voice.zh-CN.md - features/native-tools/cron.zh-CN.md - features/native-tools/system-and-utilities.zh-CN.md
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds many Simplified Chinese GitBook pages, updates two zh-CN i18n translation chunks, and introduces two Bash scripts for scanning/fixing Chinese docs plus a .gitignore rule for AI assistant artifacts. ChangesChinese documentation expansion and UI localization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 20
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gitbooks/features/integrations/README.zh-CN.md`:
- Line 19: Replace the localized link target triggers.zh-CN.md with the English
original triggers.md wherever it appears (e.g., the link in the sentence
containing "作为**触发器源**,实时事件...流入[触发器](triggers.zh-CN.md)流水线") to match the
repo's coverage strategy and avoid 404s; ensure you update all occurrences (the
reviewer noted another instance around the second occurrence) so the markdown
link points to triggers.md instead of triggers.zh-CN.md.
In `@gitbooks/features/model-routing/README.zh-CN.md`:
- Line 63: Update the broken Chinese page link on README.zh-CN.md: replace the
link target "local-ai.zh-CN.md" with the English page "local-ai.md" (or the
canonical English filename used across this batch) so untranslated pages point
to the English version; edit the line containing "[本地
AI(可选)](local-ai.zh-CN.md)" in the file and ensure the link text remains the
same while the href points to the English file to match the batch coverage
strategy.
In `@gitbooks/features/native-tools/browser-and-computer.zh-CN.md`:
- Line 26: Update the internal integration link in the sentence containing
"../integrations/README.md" so it points to the Chinese translation
"../integrations/README.zh-CN.md"; locate the line with the link text "* 驱动没有
API 或没有[原生集成](../integrations/README.md)的网站。" and replace the target path to
maintain consistent Chinese-doc internal linking.
In `@gitbooks/features/native-tools/coder.zh-CN.md`:
- Line 43: Update the markdown link target for "智能体协作" so it points to the
English page instead of the unfinished Chinese page: replace the reference to
"agent-coordination.zh-CN.md" with "agent-coordination.md" in the line
containing the link (look for the link text "智能体协作" or the existing target
"agent-coordination.zh-CN.md") to avoid a broken/unfinished Chinese page
redirect.
In `@gitbooks/features/native-tools/cron.zh-CN.md`:
- Line 37: The link target for "智能体协作" currently points to
agent-coordination.zh-CN.md which may not exist; update the markdown link target
to the English page agent-coordination.md (i.e., change the reference from
agent-coordination.zh-CN.md to agent-coordination.md) so the link resolves
correctly when the Chinese translation is not yet available.
In `@gitbooks/features/native-tools/README.zh-CN.md`:
- Around line 29-36: Update the internal links in this README table so their
language and targets match: replace references to English pages (e.g.,
"coder.md", "cron.md", "voice.md", "memory-tools.md", "agent-coordination.md",
"system-and-utilities.md", "../integrations/README.md") with their Chinese
counterparts that exist in this batch (append or switch to the .zh-CN.md
variants where available), and ensure the already-correct
"browser-and-computer.zh-CN.md" link remains unchanged; also apply the same
.zh-CN fixes to the similar links referenced later on lines 41-42.
In `@gitbooks/features/native-tools/system-and-utilities.zh-CN.md`:
- Line 28: The text contains a typo: replace the incorrect phrase "工组流" with the
correct "工作流" in the markdown content (the line containing "*
不适合更丰富工具家族的工组流部分。"); update that phrase to "* 不适合更丰富工具家族的工作流部分。" so the document
reads correctly.
In `@gitbooks/features/native-tools/voice.zh-CN.md`:
- Line 32: Fix two Chinese copy issues in the markdown content: remove the
duplicated character in the phrase "有有用的内容" in the sentence starting
"当你让它说话(或它决定有有用的内容要补充)…" and reword the awkward sentence "会议转录像任何其他来源一样" (seen
later in the same file) to read "会议转录像任何其他来源一样落在你本地记忆树中" so the meaning and
readability are correct; update the two exact strings in the document
accordingly.
In `@gitbooks/features/obsidian-wiki/auto-fetch.zh-CN.md`:
- Line 31: Replace the incorrect code-block closing fence string "```text" with
a proper closing fence "```" to ensure the Markdown code block is correctly
terminated; locate the fenced block that begins earlier in the file and change
its ending fence token from "```text" to "```".
- Line 14: Replace the English integration README links that point to
"../integrations/README.md" with the Chinese version
"../integrations/README.zh-CN.md" in this document; search for the link text
"../integrations/README.md" (appears in the sentence describing the periodic
scheduler and elsewhere) and update those occurrences so the doc consistently
links to the zh-CN integration page.
In `@gitbooks/features/obsidian-wiki/memory-tree.zh-CN.md`:
- Line 41: The fenced code block end marker currently uses the literal string
"```text" which breaks Markdown parsing; replace that closing marker with a
plain "```" so the block opens with "```text" (if desired) and closes with "```"
to properly terminate the fenced code block.
In `@gitbooks/features/obsidian-wiki/README.zh-CN.md`:
- Line 24: The markdown code block ending currently uses a fenced token that
includes a language specifier ("```text") instead of the proper closing fence;
locate the unmatched fence in README.zh-CN.md (the code block started/ended
around the snippet containing "```text" at Line 24) and replace the closing
fence with a plain triple backtick ("```") so the block is properly closed and
subsequent content renders correctly.
In `@gitbooks/features/platform.zh-CN.md`:
- Around line 38-53: The code block fence at the end of the snippet is
incorrect: replace the stray "```text" used as a closing fence with a proper
closing triple-backtick to terminate the code block that started with "```text"
at the top; update the closing fence so the block containing the Tauri shell /
Rust core / React frontend diagram is properly closed (match the opening
"```text" fence) to prevent subsequent content from being rendered as code.
In `@gitbooks/features/privacy-and-security.zh-CN.md`:
- Line 21: The link in privacy-and-security.zh-CN.md currently points to
model-routing/local-ai.zh-CN.md which may be missing; update the markdown link
target so the local AI link falls back to the English page by replacing
model-routing/local-ai.zh-CN.md with the English page (e.g.
model-routing/local-ai.md) so the anchor **本地 AI** points to the English
fallback.
In `@gitbooks/features/token-compression.zh-CN.md`:
- Around line 30-38: The markdown code block that begins with "```text" is
incorrectly closed with "```text" again on the last line; update the closing
fence to a plain "```" so the block is properly terminated (locate the opening
"```text" and replace the final "```text" at the end of that block with "```").
In `@gitbooks/overview/getting-started.zh-CN.md`:
- Line 70: Update the markdown link for the display text "**原生语音**" so it points
to the Chinese version of the voice doc instead of the English one: replace the
current link target "../features/native-tools/voice.md" with the Chinese file
"voice.zh-CN.md" (keeping the same relative location and link formatting) so
Chinese readers stay on the localized content.
In `@scripts/i18n-doc-fix.sh`:
- Around line 14-15: The glob loop using the pattern "for f in
gitbooks/**/*.zh-CN.md" must enable bash globstar or be replaced with a
find-based walk (enable via shopt -s globstar) so nested matches aren’t skipped;
the perl fence rewrite (the expression matching ^(```)$) must be changed to only
target opening fences (append "text" to an opening triple-backtick line, e.g.,
match an opening fence with optional trailing spaces and not touch the closing
fence) rather than altering any line that equals ```; and the sidecar removal
regexes (the s/[Ss]idecar[^s]*(sidecar)?//g and s/\bsidecar\b//g patterns) must
be tightened to only remove the standalone word "sidecar" (use case-insensitive
word-boundary matching like \bsidecar\b with an i flag) or explicit
parenthesized/standalone variants so you don’t delete adjacent content—apply
these fixes where the loop, the perl fence rewrite, and the sidecar regexes
appear in the script.
- Around line 18-26: The current perl replacement (perl -i -pe
's/^(```)$/$1text/' in the block guarded by DRY_RUN) indiscriminately rewrites
every standalone ``` line (including closing fences), which breaks CommonMark;
replace that two-step perl approach with a stateful transformation that only
appends "text" to opening fences and leaves closing fences untouched: when not
in DRY_RUN, read each "$f" and track an in_block flag so the first encountered
``` becomes ```text and sets in_block=1, subsequent ``` when in_block resets it
(keeps it as ```), and all other lines are passed through unchanged; remove the
perl '```texttext' fallback since proper state handling prevents
double-appending.
In `@scripts/i18n-doc-scan.sh`:
- Around line 11-13: The UNLOCALIZED command uses a while loop "while read f;
do" which can interpret backslashes in filenames as escapes; change that loop to
use "read -r" (i.e., "while read -r f; do") so filenames are read raw and not
mangled—update the pipeline that assigns UNLOCALIZED (the find ... | while read
f; do ... done) to use read -r.
- Around line 25-38: The script currently misdetects closing fences because it
tests the bare line against ^\`\`\`[a-zA-Z] and never tracks open/close state;
update scripts/i18n-doc-scan.sh to use a read loop with IFS= and read -r when
iterating files, introduce an in_block boolean (e.g., in_block=0) and toggle it
when encountering a fence line: when you see a fence that includes a language
(matches ^\`\`\`[A-Za-z]) set in_block=1 and skip reporting, when you see a bare
fence and in_block==0 treat it as a missing-language opening fence (report via
NO_LANG echo) and set in_block=1, when you see a bare fence and in_block==1
treat it as a closing fence and set in_block=0 (no report); also use
prev_line/next_line only if needed or remove them to avoid confusion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9a939803-8665-4662-8690-09993a64e907
📒 Files selected for processing (25)
.gitignoreapp/src/lib/i18n/chunks/zh-CN-3.tsapp/src/lib/i18n/chunks/zh-CN-5.tsdocs/SECURITY_AUDIT.mdgitbooks/features/integrations/README.zh-CN.mdgitbooks/features/mascot/README.zh-CN.mdgitbooks/features/model-routing/README.zh-CN.mdgitbooks/features/native-tools/README.zh-CN.mdgitbooks/features/native-tools/browser-and-computer.zh-CN.mdgitbooks/features/native-tools/coder.zh-CN.mdgitbooks/features/native-tools/cron.zh-CN.mdgitbooks/features/native-tools/system-and-utilities.zh-CN.mdgitbooks/features/native-tools/voice.zh-CN.mdgitbooks/features/native-tools/web-scraper.zh-CN.mdgitbooks/features/native-tools/web-search.zh-CN.mdgitbooks/features/obsidian-wiki/README.zh-CN.mdgitbooks/features/obsidian-wiki/agentmemory-backend.zh-CN.mdgitbooks/features/obsidian-wiki/auto-fetch.zh-CN.mdgitbooks/features/obsidian-wiki/memory-tree.zh-CN.mdgitbooks/features/platform.zh-CN.mdgitbooks/features/privacy-and-security.zh-CN.mdgitbooks/features/token-compression.zh-CN.mdgitbooks/overview/getting-started.zh-CN.mdscripts/i18n-doc-fix.shscripts/i18n-doc-scan.sh
| 1. 作为**智能体工具**,模型可以直接调用。 | ||
| 2. 作为**记忆源**,[自动拉取](../obsidian-wiki/auto-fetch.zh-CN.md)每二十分钟将其同步到[记忆树](../obsidian-wiki/memory-tree.zh-CN.md)。 | ||
| 3. 作为**个人化信号**,你在各服务上的活动为你的偏好模型提供数据。 | ||
| 4. 作为**触发器源**,实时事件(新邮件、新 charge、入站 DM)流入[触发器](triggers.zh-CN.md)流水线,可以自动触发智能体操作。 |
There was a problem hiding this comment.
将未翻译目标改回英文链接,避免 404。
triggers.zh-CN.md 与当前批次覆盖策略不一致(该页仍应指向英文原文)。建议改为英文目标文件路径。
Suggested patch
-4. 作为**触发器源**,实时事件(新邮件、新 charge、入站 DM)流入[触发器](triggers.zh-CN.md)流水线,可以自动触发智能体操作。
+4. 作为**触发器源**,实时事件(新邮件、新 charge、入站 DM)流入[触发器](triggers.md)流水线,可以自动触发智能体操作。
...
-* [触发器](triggers.zh-CN.md),已连接集成的实时事件以及它们如何触发智能体操作。
+* [触发器](triggers.md),已连接集成的实时事件以及它们如何触发智能体操作。Also applies to: 83-83
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gitbooks/features/integrations/README.zh-CN.md` at line 19, Replace the
localized link target triggers.zh-CN.md with the English original triggers.md
wherever it appears (e.g., the link in the sentence containing
"作为**触发器源**,实时事件...流入[触发器](triggers.zh-CN.md)流水线") to match the repo's coverage
strategy and avoid 404s; ensure you update all occurrences (the reviewer noted
another instance around the second occurrence) so the markdown link points to
triggers.md instead of triggers.zh-CN.md.
|
|
||
| - [智能 Token 压缩](../token-compression.zh-CN.md)。什么使大型推理调用负担得起。 | ||
| - [原生工具](../native-tools/README.zh-CN.md)。不同的工具调用暗示不同的路由。 | ||
| - [本地 AI(可选)](local-ai.zh-CN.md)。轻量聊天 hint 可以在设备上运行。 |
There was a problem hiding this comment.
未翻译页面应链接英文版,当前目标可能失效。
Line 63 指向 local-ai.zh-CN.md,建议改为英文目标,和本批次覆盖策略保持一致。
Suggested patch
-- [本地 AI(可选)](local-ai.zh-CN.md)。轻量聊天 hint 可以在设备上运行。
+- [本地 AI(可选)](local-ai.md)。轻量聊天 hint 可以在设备上运行。📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - [本地 AI(可选)](local-ai.zh-CN.md)。轻量聊天 hint 可以在设备上运行。 | |
| - [本地 AI(可选)](local-ai.md)。轻量聊天 hint 可以在设备上运行。 |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gitbooks/features/model-routing/README.zh-CN.md` at line 63, Update the
broken Chinese page link on README.zh-CN.md: replace the link target
"local-ai.zh-CN.md" with the English page "local-ai.md" (or the canonical
English filename used across this batch) so untranslated pages point to the
English version; edit the line containing "[本地 AI(可选)](local-ai.zh-CN.md)" in
the file and ensure the link text remains the same while the href points to the
English file to match the batch coverage strategy.
|
|
||
| ## 适用于 | ||
|
|
||
| * 驱动没有 API 或没有[原生集成](../integrations/README.md)的网站。 |
There was a problem hiding this comment.
将集成文档链接切到中文版本。
Line 26 当前指向 ../integrations/README.md,建议改为 ../integrations/README.zh-CN.md,保持中文文档内链一致。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gitbooks/features/native-tools/browser-and-computer.zh-CN.md` at line 26,
Update the internal integration link in the sentence containing
"../integrations/README.md" so it points to the Chinese translation
"../integrations/README.zh-CN.md"; locate the line with the link text "* 驱动没有
API 或没有[原生集成](../integrations/README.md)的网站。" and replace the target path to
maintain consistent Chinese-doc internal linking.
| ## 另见 | ||
|
|
||
| * [系统与工具](system-and-utilities.zh-CN.md) —— `shell`、`node_exec`、`npm_exec` 用于开发循环的其余部分。 | ||
| * [智能体协作](agent-coordination.zh-CN.md) —— `todo_write`、`spawn_subagent` 用于更大的重构。 |
There was a problem hiding this comment.
agent-coordination 链接目标应回退到英文页。
Line 43 当前是 agent-coordination.zh-CN.md,按本 PR 说明该页仍在后续批次,建议先链接到英文 agent-coordination.md 避免失效跳转。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gitbooks/features/native-tools/coder.zh-CN.md` at line 43, Update the
markdown link target for "智能体协作" so it points to the English page instead of the
unfinished Chinese page: replace the reference to "agent-coordination.zh-CN.md"
with "agent-coordination.md" in the line containing the link (look for the link
text "智能体协作" or the existing target "agent-coordination.zh-CN.md") to avoid a
broken/unfinished Chinese page redirect.
| ## 另见 | ||
|
|
||
| * [系统与工具](system-and-utilities.zh-CN.md) —— 一次性 `schedule` 工具。 | ||
| * [智能体协作](agent-coordination.zh-CN.md) —— 向子智能体扇出的任务。 |
There was a problem hiding this comment.
修正未落地翻译页的链接目标。
Line 37 指向 agent-coordination.zh-CN.md;若该页面尚未翻译,建议改为英文 agent-coordination.md,避免无效链接。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gitbooks/features/native-tools/cron.zh-CN.md` at line 37, The link target for
"智能体协作" currently points to agent-coordination.zh-CN.md which may not exist;
update the markdown link target to the English page agent-coordination.md (i.e.,
change the reference from agent-coordination.zh-CN.md to agent-coordination.md)
so the link resolves correctly when the Chinese translation is not yet
available.
| UNLOCALIZED=$(find gitbooks -name "*.zh-CN.md" -exec grep -l '\.md)' {} \; 2>/dev/null | while read f; do | ||
| grep '\.md)' "$f" 2>/dev/null | grep -v '\.zh-CN\.md)' | sed "s|^|$f:|" || true | ||
| done) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant section with line numbers
nl -ba scripts/i18n-doc-scan.sh | sed -n '1,80p'
# Search for other instances of `while read` in the same script tree
rg -n --hidden --no-ignore -S "while read( |$)" scripts || trueRepository: tinyhumansai/openhuman
Length of output: 109
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Print file with line numbers (no `nl` available)
awk '{printf "%6d %s\n", NR, $0}' scripts/i18n-doc-scan.sh | sed -n '1,120p'
# Find occurrences of `while read` in the repo (scripts only)
rg -n --hidden --no-ignore -S "while[[:space:]]+read([[:space:]]|$)" scripts || trueRepository: tinyhumansai/openhuman
Length of output: 3522
Use read -r in the while loop to keep filenames intact
On scripts/i18n-doc-scan.sh line 11, while read f; do can treat backslashes as escape characters, potentially corrupting paths.
Suggested fix
-UNLOCALIZED=$(find gitbooks -name "*.zh-CN.md" -exec grep -l '\.md)' {} \; 2>/dev/null | while read f; do
+UNLOCALIZED=$(find gitbooks -name "*.zh-CN.md" -exec grep -l '\.md)' {} \; 2>/dev/null | while read -r f; do📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| UNLOCALIZED=$(find gitbooks -name "*.zh-CN.md" -exec grep -l '\.md)' {} \; 2>/dev/null | while read f; do | |
| grep '\.md)' "$f" 2>/dev/null | grep -v '\.zh-CN\.md)' | sed "s|^|$f:|" || true | |
| done) | |
| UNLOCALIZED=$(find gitbooks -name "*.zh-CN.md" -exec grep -l '\.md)' {} \; 2>/dev/null | while read -r f; do | |
| grep '\.md)' "$f" 2>/dev/null | grep -v '\.zh-CN\.md)' | sed "s|^|$f:|" || true | |
| done) |
🧰 Tools
🪛 Shellcheck (0.11.0)
[info] 11-11: read without -r will mangle backslashes.
(SC2162)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/i18n-doc-scan.sh` around lines 11 - 13, The UNLOCALIZED command uses
a while loop "while read f; do" which can interpret backslashes in filenames as
escapes; change that loop to use "read -r" (i.e., "while read -r f; do") so
filenames are read raw and not mangled—update the pipeline that assigns
UNLOCALIZED (the find ... | while read f; do ... done) to use read -r.
| NO_LANG=$(find gitbooks -name "*.zh-CN.md" -exec sh -c ' | ||
| for f; do | ||
| line_num=0 | ||
| while IFS= read -r line; do | ||
| line_num=$((line_num + 1)) | ||
| if [[ "$line" == "\`\`\`" ]]; then | ||
| # 检查前一行是否也是 ``` 或空(是代码块开始) | ||
| # 简单判断:当前行是 ``` 且下一行不是以 ``` 开头(结尾没有语言标识) | ||
| prev_line=$(sed "$((line_num - 1))q;d" "$f" 2>/dev/null || echo "") | ||
| next_line=$(sed "$((line_num + 1))q;d" "$f" 2>/dev/null || echo "") | ||
| if [[ ! "$line" =~ ^\`\`\`[a-zA-Z] ]]; then | ||
| echo "$f:$line_num: $line" | ||
| fi | ||
| fi |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="scripts/i18n-doc-scan.sh"
echo "== file =="
ls -l "$FILE"
echo
echo "== lines 1-120 =="
nl -ba "$FILE" | sed -n '1,120p'
echo
echo "== search: read f / read -r / fence logic =="
rg -n "read f|read -r|\`\`\`|in_block|MD040|missing language|gitbooks" "$FILE" || trueRepository: tinyhumansai/openhuman
Length of output: 232
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="scripts/i18n-doc-scan.sh"
echo "== file =="
ls -l "$FILE"
echo
echo "== lines 1-200 (with numbers via awk) =="
awk '{printf "%5d %s\n", NR, $0}' "$FILE" | sed -n '1,200p'
echo
echo "== search: read f / read -r / fence logic / MD040 =="
rg -n "read f|read -r|\`\`\`|in_block|MD040|missing language|gitbooks" "$FILE" || trueRepository: tinyhumansai/openhuman
Length of output: 4148
MD040 fence detection is flagging closing ``` blocks as “missing language”.
In scripts/i18n-doc-scan.sh (lines ~30-37), the script enters only when the current line is exactly and then unconditionally reports it as missing language because it checks `^[a-zA-Z]against the same bare ``` line (which can never match). This means both opening and closing fences are echoed;prev_line/next_lineare computed but unused. Track open/close state (e.g., anin_block` flag) and only report bare ``` when starting a block.
Also minor: the while read f; do loop (line ~11) should use read -r (and IFS=) to avoid backslash escaping in filenames.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/i18n-doc-scan.sh` around lines 25 - 38, The script currently
misdetects closing fences because it tests the bare line against ^\`\`\`[a-zA-Z]
and never tracks open/close state; update scripts/i18n-doc-scan.sh to use a read
loop with IFS= and read -r when iterating files, introduce an in_block boolean
(e.g., in_block=0) and toggle it when encountering a fence line: when you see a
fence that includes a language (matches ^\`\`\`[A-Za-z]) set in_block=1 and skip
reporting, when you see a bare fence and in_block==0 treat it as a
missing-language opening fence (report via NO_LANG echo) and set in_block=1,
when you see a bare fence and in_block==1 treat it as a closing fence and set
in_block=0 (no report); also use prev_line/next_line only if needed or remove
them to avoid confusion.
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
gitbooks/features/obsidian-wiki/memory-tree.zh-CN.md (1)
62-63:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win显式指向 zh-CN 文档以避免跳回英文页。
Line 62 的
./和 Line 168 的../model-routing/是目录链接,可能解析到默认README.md(英文)。为保证中文阅读链路稳定,建议改为显式README.zh-CN.md。建议修改
-| `wiki/` | Markdown 存储库 —— 见 [Obsidian Wiki](./) | +| `wiki/` | Markdown 存储库 —— 见 [Obsidian Wiki](./README.zh-CN.md) | ... -**路由。** 智能标签页还显示智能体每个任务使用的模型——见[自动模型路由](../model-routing/)。 +**路由。** 智能标签页还显示智能体每个任务使用的模型——见[自动模型路由](../model-routing/README.zh-CN.md)。Also applies to: 168-168
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gitbooks/features/obsidian-wiki/memory-tree.zh-CN.md` around lines 62 - 63, The directory links `./` (line 62) and `../model-routing/` (line 168) currently point to the default README which may resolve to English; update those Markdown links to explicitly target the Chinese landing files by replacing `./` with `./README.zh-CN.md` and `../model-routing/` with `../model-routing/README.zh-CN.md` (ensure the files exist and names match) so the Obsidian Wiki links always open the zh-CN README.
🧹 Nitpick comments (1)
gitbooks/features/model-routing/local-ai.zh-CN.md (1)
12-12: 💤 Low valuePolish awkward phrasing for readability.
“硬件敏感的占用” reads awkwardly; consider “对硬件较敏感的资源占用” (or equivalent) for clearer Chinese.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gitbooks/features/model-routing/local-ai.zh-CN.md` at line 12, Replace the awkward phrase "硬件敏感的占用" in the sentence that contrasts on-device vs cloud responsibilities with a clearer Chinese expression such as "对硬件较敏感的资源占用" (or an equivalent like "对硬件敏感的资源使用"), ensuring the revised sentence reads smoothly: "结果是对硬件较敏感的资源占用,与产品其余部分所需的东西冲突。" Update the surrounding clause if needed so the full sentence remains fluent and natural.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gitbooks/features/mascot/meeting-agents.zh-CN.md`:
- Line 12: The sentence contains duplicated wording "决定有有用的内容" in the line that
reads "在你(或它)决定有有用的内容要补充时做出贡献"; update that phrase to "决定有用的内容" so the sentence
becomes "...在你(或它)决定有用的内容要补充时做出贡献", preserving the rest of the sentence
punctuation and spacing.
- Line 32: Replace the English-target internal links on this zh-CN page with
their zh-CN counterparts so localized navigation works: update the link in the
sentence referencing "自动模型路由" to point to ../model-routing/README.zh-CN.md and
change the links listed in the "另见" section to ../privacy-and-security.zh-CN.md
and ../model-routing/README.zh-CN.md (and any other English targets on this page
such as at lines ~75 and ~94) so all internal anchors reference the zh-CN pages.
In `@gitbooks/features/model-routing/local-ai.zh-CN.md`:
- Line 18: Update internal links in
gitbooks/features/model-routing/local-ai.zh-CN.md so they point to the Chinese
translations instead of English pages: replace occurrences of memory-tree.md,
voice.md, README.md, and privacy-and-security.md (and the other instances noted
at lines 30, 33, 36 and 97–99) with memory-tree.zh-CN.md, voice.zh-CN.md,
README.zh-CN.md, and privacy-and-security.zh-CN.md respectively to ensure
consistent in-language navigation.
In `@gitbooks/features/native-tools/agent-coordination.zh-CN.md`:
- Line 22: Update the Chinese description for the row containing
`check_onboarding_status` / `complete_onboarding`: replace “门控行为于用户是否完成入门” with
the clearer phrasing “根据用户是否完成入门进行门控” so the gate logic reads naturally and
unambiguously in Chinese.
In `@gitbooks/features/native-tools/integrations.zh-CN.md`:
- Line 8: The phrase "通过单一代理工具表面调用" is ambiguous; replace it with a clearer term
such as "通过单一代理工具接口调用" or "通过统一代理工具调用" in the sentence describing OpenHuman
agents calling third-party services (the string "通过单一代理工具表面调用" in the text).
Update that exact phrase to the chosen alternative and keep the rest of the
sentence intact so it reads clearly (e.g., "OpenHuman 的智能体可以通过单一代理工具接口调用 [118+
第三方服务]——Gmail、Notion、GitHub、Slack、Stripe、日历,以及长长的尾部的服务。").
---
Outside diff comments:
In `@gitbooks/features/obsidian-wiki/memory-tree.zh-CN.md`:
- Around line 62-63: The directory links `./` (line 62) and `../model-routing/`
(line 168) currently point to the default README which may resolve to English;
update those Markdown links to explicitly target the Chinese landing files by
replacing `./` with `./README.zh-CN.md` and `../model-routing/` with
`../model-routing/README.zh-CN.md` (ensure the files exist and names match) so
the Obsidian Wiki links always open the zh-CN README.
---
Nitpick comments:
In `@gitbooks/features/model-routing/local-ai.zh-CN.md`:
- Line 12: Replace the awkward phrase "硬件敏感的占用" in the sentence that contrasts
on-device vs cloud responsibilities with a clearer Chinese expression such as
"对硬件较敏感的资源占用" (or an equivalent like "对硬件敏感的资源使用"), ensuring the revised
sentence reads smoothly: "结果是对硬件较敏感的资源占用,与产品其余部分所需的东西冲突。" Update the surrounding
clause if needed so the full sentence remains fluent and natural.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b44eef09-6afe-48c1-9dd5-9ab90a1b5b9f
📒 Files selected for processing (13)
gitbooks/features/integrations/triggers.zh-CN.mdgitbooks/features/mascot/meeting-agents.zh-CN.mdgitbooks/features/model-routing/local-ai.zh-CN.mdgitbooks/features/native-tools/agent-coordination.zh-CN.mdgitbooks/features/native-tools/integrations.zh-CN.mdgitbooks/features/native-tools/memory-tools.zh-CN.mdgitbooks/features/native-tools/voice.zh-CN.mdgitbooks/features/obsidian-wiki/README.zh-CN.mdgitbooks/features/obsidian-wiki/auto-fetch.zh-CN.mdgitbooks/features/obsidian-wiki/memory-tree.zh-CN.mdgitbooks/features/platform.zh-CN.mdgitbooks/features/subconscious.zh-CN.mdgitbooks/features/token-compression.zh-CN.md
✅ Files skipped from review due to trivial changes (7)
- gitbooks/features/native-tools/voice.zh-CN.md
- gitbooks/features/integrations/triggers.zh-CN.md
- gitbooks/features/native-tools/memory-tools.zh-CN.md
- gitbooks/features/obsidian-wiki/README.zh-CN.md
- gitbooks/features/platform.zh-CN.md
- gitbooks/features/subconscious.zh-CN.md
- gitbooks/features/obsidian-wiki/auto-fetch.zh-CN.md
…arity in batch B zh-CN docs
|
@graycyrus The cargo test failure is No space left on device on the GitHub Actions runner. This PR only touches .zh-CN.md docs files with zero Rust code changes. Could you re-run the failed job or override the gate? Thanks! |
graycyrus
left a comment
There was a problem hiding this comment.
Review — graycyrus
Solid batch of zh-CN translations. The doc quality is good and the coverage is meaningful for Chinese users. Two issues need addressing before merge — both are about scope, not translation quality.
Summary of changes
| Area | Files | Notes |
|---|---|---|
| i18n docs (new) | 26 .zh-CN.md files |
Core feature translations — integrations, mascot, model-routing, native-tools, obsidian-wiki, privacy, token-compression, getting-started |
| i18n strings (fix) | zh-CN-3.ts, zh-CN-5.ts |
Previously untranslated UI strings now localized |
| Scripts | i18n-doc-fix.sh, i18n-doc-scan.sh |
New validation/cleanup utilities |
| Unrelated | docs/SECURITY_AUDIT.md, .gitignore |
See findings below |
What CodeRabbit already covers (skipped)
CodeRabbit flagged ~18 issues across link targets, fence syntax, typos, and script bugs. I'm not repeating those — see their review thread. Note: several of their "broken link" findings (triggers.zh-CN.md, local-ai.zh-CN.md, agent-coordination.zh-CN.md) are actually false positives since those files ARE being added in this PR.
|
@JAYcodr unresolved review feedback from graycyrus — please address before we review. |
|
Hi @graycyrus, thanks for the detailed review. Here's how I'm addressing each point: 1. SECURITY_AUDIT.md — 超出范围 **2. Broken closing fences (````text
3. Destructive sidecar regex in perl -i -pe 's/\bsidecar\b/in-process core/gi' "$f"
4. Missing trailing newlines
Will fix in the script.
I'll push the fixes shortly and re-request review. |
…gitignore scope, localize links in README.zh-CN.md - Remove docs/SECURITY_AUDIT.md (out of scope for i18n PR) - Revert unrelated .gitignore additions (.codegraph/, docs/codegraph-architecture.md) - Localize all native-tools/README.zh-CN.md table links to .zh-CN.md targets
|
@graycyrus All three points addressed in f85695c: |
…ine in i18n-doc-fix.sh - Replace greedy [Ss]idecar[^s]* regex with word-boundary \bsidecar\b match - Add missing trailing newline to script file
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/i18n-doc-fix.sh (1)
13-13:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winStep labels are inconsistent (
1/3,3/3,4/4).The script has 4 passes but labels them
【1/3】,【2/3】,【3/3】,【4/4】. Make them all/4for consistent progress output.Proposed fix
-echo "【1/3】修复裸代码块..." +echo "【1/4】修复裸代码块..." @@ -echo "【2/3】修复 http:// → https://..." +echo "【2/4】修复 http:// → https://..." @@ -echo "【3/3】移除 sidecar 术语(core 已内联)..." +echo "【3/4】移除 sidecar 术语(core 已内联)..."Also applies to: 51-51, 68-68
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n-doc-fix.sh` at line 13, Update the inconsistent progress labels in the script by changing every echo that shows a step like "【1/3】", "【2/3】", "【3/3】" to use "/4" instead (i.e., "【1/4】", "【2/4】", "【3/4】") so the four passes report consistent progress; locate the echo statements by their current text (e.g., the lines starting with echo "【1/3】修复裸代码块...", echo "【2/3】...", echo "【3/3】...") and leave the final "【4/4】" as-is.
♻️ Duplicate comments (2)
scripts/i18n-doc-fix.sh (2)
14-14:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
gitbooks/**/*.zh-CN.mdstill requiresglobstarto recurse.Without
shopt -s globstar,**behaves like*in bash and nested matches are silently skipped — all four passes are affected. Either enable globstar at the top of the script, or switch to afind-based walk.Proposed fix
#!/bin/bash +shopt -s globstar nullglob # i18n-doc-fix.sh - 自动修复可识别的问题🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n-doc-fix.sh` at line 14, The glob pattern gitbooks/**/*.zh-CN.md requires Bash globstar to recurse; enable it by adding a shopt -s globstar near the top of scripts/i18n-doc-fix.sh before the for loop (so the for f in gitbooks/**/*.zh-CN.md; do line works), or replace that loop with a find-based walk (e.g., use find gitbooks -type f -name "*.zh-CN.md" with a null-delimited read loop) to reliably discover nested files; update only the script initialization or the loop accordingly.
22-25:⚠️ Potential issue | 🟠 Major | ⚡ Quick winClosing code fences are still being rewritten to
```text.
perl -i -pe 's/^(```)$/$1text/'indiscriminately rewrites every bareline — including closing fences. Per CommonMark, closing fences cannot carry an info string, so spec-compliant renderers may treat the block as unclosed. The follow-up `s/texttext/```text/only catches the case where the opening was alreadytext`-tagged; it does not protect closing fences.Use a stateful pass that only annotates opening fences:
Proposed fix
- perl -i -pe 's/^(```)$/$1text/' "$f" - # 但要处理 ```text 已经存在的情况,我们再把 ```texttext 变回来 - perl -i -pe 's/```texttext/```text/' "$f" + awk ' + /^```$/ { + if (!in_block) { print "```text"; in_block=1; next } + else { print "```"; in_block=0; next } + } + { print } + ' "$f" > "$f.tmp" && mv "$f.tmp" "$f"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n-doc-fix.sh` around lines 22 - 25, The current two perl lines (perl -i -pe 's/^(```)$/$1text/' "$f" and perl -i -pe 's/```texttext/```text/' "$f") wrongly annotate closing fences; replace them with a stateful awk pass that tracks in_block and only converts bare opening "```" to "```text" while leaving closing fences as "```" (e.g. the provided awk script that prints "```text" when !in_block and "```" when in_block, writing to "$f.tmp" and mv back to "$f").
🧹 Nitpick comments (1)
scripts/i18n-doc-fix.sh (1)
1-1: ⚡ Quick winConsider enabling strict mode.
Adding
set -euo pipefailwould make the script fail fast on unexpected errors (e.g., a failingperlortailinvocation) instead of silently continuing through subsequent passes. Combined withshopt -s globstar nullglob, this also makes the empty-glob case safe.#!/bin/bash +set -euo pipefail +shopt -s globstar nullglob🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n-doc-fix.sh` at line 1, Add strict mode to the script: enable "set -euo pipefail" at the top (after the existing shebang) so the script exits on errors, undefined variables, and pipeline failures, and also enable "shopt -s globstar nullglob" to make recursive globs and empty-glob handling safe; update any code relying on undefined variables or empty-glob behavior accordingly (look for the script header and any glob usages in this file to verify compatibility).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@scripts/i18n-doc-fix.sh`:
- Line 13: Update the inconsistent progress labels in the script by changing
every echo that shows a step like "【1/3】", "【2/3】", "【3/3】" to use "/4" instead
(i.e., "【1/4】", "【2/4】", "【3/4】") so the four passes report consistent progress;
locate the echo statements by their current text (e.g., the lines starting with
echo "【1/3】修复裸代码块...", echo "【2/3】...", echo "【3/3】...") and leave the final
"【4/4】" as-is.
---
Duplicate comments:
In `@scripts/i18n-doc-fix.sh`:
- Line 14: The glob pattern gitbooks/**/*.zh-CN.md requires Bash globstar to
recurse; enable it by adding a shopt -s globstar near the top of
scripts/i18n-doc-fix.sh before the for loop (so the for f in
gitbooks/**/*.zh-CN.md; do line works), or replace that loop with a find-based
walk (e.g., use find gitbooks -type f -name "*.zh-CN.md" with a null-delimited
read loop) to reliably discover nested files; update only the script
initialization or the loop accordingly.
- Around line 22-25: The current two perl lines (perl -i -pe 's/^(```)$/$1text/'
"$f" and perl -i -pe 's/```texttext/```text/' "$f") wrongly annotate closing
fences; replace them with a stateful awk pass that tracks in_block and only
converts bare opening "```" to "```text" while leaving closing fences as "```"
(e.g. the provided awk script that prints "```text" when !in_block and "```"
when in_block, writing to "$f.tmp" and mv back to "$f").
---
Nitpick comments:
In `@scripts/i18n-doc-fix.sh`:
- Line 1: Add strict mode to the script: enable "set -euo pipefail" at the top
(after the existing shebang) so the script exits on errors, undefined variables,
and pipeline failures, and also enable "shopt -s globstar nullglob" to make
recursive globs and empty-glob handling safe; update any code relying on
undefined variables or empty-glob behavior accordingly (look for the script
header and any glob usages in this file to verify compatibility).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c07ad8ad-0a6c-4447-8897-58de7d1910ea
📒 Files selected for processing (1)
scripts/i18n-doc-fix.sh
…l fences, strict mode - Replace bash ** glob with find + null-delimited read (bash 3.2 compat) - Replace destructive perl fence regex with stateful opening-only rewrite - Add set -euo pipefail for strict error handling - Normalize step labels to /4 consistency
The script cannot reliably distinguish opening from closing fences. Every run risks double-appending 'text' to already-correct files or misclassifying closing fences as openings. These fixes are better done once, correctly, at translation time rather than by an automated rewriter.
|
@graycyrus All issues addressed:
CI is all green. Ready for re-review. |
graycyrus
left a comment
There was a problem hiding this comment.
Review — graycyrus (continuation)
All three findings from my previous REQUEST_CHANGES have been addressed:
- ✅
SECURITY_AUDIT.mdremoved - ✅ Unrelated
.codegraph/gitignore entries removed - ✅
native-tools/README.zh-CN.mdtable now links to.zh-CN.mdtargets
Nice work cleaning those up. The translation quality remains solid.
One remaining pattern I noticed that CodeRabbit only partially flagged: several files still link to English .md targets where the .zh-CN.md version exists in this PR. Noted inline below — all minor.
|
|
||
| ## 系统要求 | ||
|
|
||
| OpenHuman 支持 **macOS、Windows 和 Linux** 桌面端。建议 4 GB 以上内存;如果要摄入超大型邮箱或仓库,或在同一台机器上运行[本地模型](../features/model-routing/local-ai.md),建议 16 GB 以上。 |
There was a problem hiding this comment.
[minor] Several links in this file still point to English targets where zh-CN versions exist in this very PR:
- Line 18:
local-ai.md→local-ai.zh-CN.md - Line 22:
meeting-agents.md→meeting-agents.zh-CN.md - Line 67:
meeting-agents.md→meeting-agents.zh-CN.md - Line 71:
subconscious.md→subconscious.zh-CN.md
CodeRabbit caught the voice.md one at line 70 but missed these four.
|
|
||
| ## 另见 | ||
|
|
||
| * [第三方集成](../integrations/README.md)。自动拉取运行的连接器层。 |
There was a problem hiding this comment.
[minor] The "另见" section links to ../integrations/README.md — should be ../integrations/README.zh-CN.md since that file exists in this PR. Same issue as line 14 (which CodeRabbit already flagged).
There was a problem hiding this comment.
@graycyrus 感谢 review!所有 4 处链接已修复,外加 CodeRabbit 之前标记的 voice.md 和 auto-fetch.zh-CN.md 中的 2 处README.md,一并本地化了:
• local-ai.md → local-ai.zh-CN.md
• meeting-agents.md → meeting-agents.zh-CN.md(2 处)
• voice.md → voice.zh-CN.md
• subconscious.md → subconscious.zh-CN.md
• integrations/README.md → integrations/README.zh-CN.md(2 处)
最新 commit: 036e9d4。Ready for re-review 🙏
…md and auto-fetch.zh-CN.md
Summary
.zh-CN文件,之前保留的英文链接现在可指向中文版).zh-CN链接local-ai.zh-CN.md和triggers.zh-CN.md等尚未翻译文件的错误链接.md文档,无代码变更Problem
Solution
.zh-CN.md不存在的链接(如 triggers、subconscious、local-ai、agent-coordination),保持指向英文原文,在 Related 中标记后续批次覆盖计划Submission Checklist
pnpm typecheck) (N/A: Markdown docs only)pnpm build) (N/A: Markdown docs only)pnpm format:check) (N/A: Markdown docs only)Impact
Related
AI Authored PR Metadata
Linear Issue
Commit & Branch
docs/i18n-batch-b-core-featuresValidation Run
pnpm --filter openhuman-app format:check— N/A: no code changedpnpm typecheck— N/A: no code changedValidation Blocked
Behavior Changes
Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit
Localization
Documentation
Chores