Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/auto-translate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Auto Translate Docs

on:
push:
paths:
- 'content/cn/**.md'
- 'content/cn/settings.yml'
- 'scripts/auto-translate/languages.json'

workflow_dispatch:
inputs:
full:
description: 'Full translation (translate all files, not just changed)'
type: boolean
default: false

jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run auto-translate
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
run: |
if [ "${{ inputs.full }}" = "true" ]; then
node scripts/auto-translate/index.mjs run --full=true
else
node scripts/auto-translate/index.mjs run --changed-only=true
fi

- name: Check for translation changes
id: changes
run: |
git add -A
if git diff --cached --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Create PR branch and commit
if: steps.changes.outputs.has_changes == 'true'
id: commit
run: |
BRANCH="auto-translate/$(date +%Y%m%d-%H%M%S)"
echo "branch=$BRANCH" >> $GITHUB_OUTPUT

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git checkout -b "$BRANCH"
git commit -m "docs: auto-translate updated content

Triggered by: ${{ github.sha }}
Source branch: ${{ github.ref_name }}"

git push origin "$BRANCH"

- name: Create Pull Request
if: steps.changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="${{ steps.commit.outputs.branch }}"
BASE_BRANCH="${{ github.ref_name }}"

# Collect list of changed translation files
CHANGED_FILES=$(git diff origin/${BASE_BRANCH}...HEAD --name-only | grep -v '^content/cn/' | head -20 | sed 's/^/- /' || true)

gh pr create \
--title "docs: auto-translate $(date +%Y-%m-%d)" \
--body "## Auto-translated Documentation

This PR was automatically generated by the auto-translate workflow.

**Triggered by commit:** \`${{ github.sha }}\`
**Source branch:** \`${BASE_BRANCH}\`

### Changed files
${CHANGED_FILES}

---
_Generated by [auto-translate workflow](.github/workflows/auto-translate.yml)_" \
--base "${BASE_BRANCH}" \
--head "${BRANCH}" || true
13 changes: 11 additions & 2 deletions content/cn/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,28 @@ nav:

- "(ri:file-code-line) API 参考文档": api-reference/search-memories

- "(ri:cpu-line) 自研模型说明":
- "(ri:flask-line) 抽取模型":
- "(ri:file-code-line) 使用示例": self_developed_model/extraction_usage_example.md

- "(ri:puzzle-line) MCP与Agent框架支持":
- "(ri:tools-line) MCP 服务":
- "(ri:book-open-line) 使用指南": mcp_agent/mcp/guide.md

- "(ri:robot-line) Agent开发":
- "(ri:book-open-line) 使用指南": mcp_agent/agent/guide.md

- "(ri:robot-line) Openclaw":
- "(ri:robot-line) Agent":
- "(ri:book-open-line) 云插件 vs 本地插件": openclaw/plugin_compare.md
- "(ri:file-list-3-line) 更新日志": openclaw/changes.md
- "(ri:download-line) 安装指南":
- "(ri:cloud-line) OpenClaw 云插件": openclaw/guide.md
- "(ri:computer-line) OpenClaw 本地插件": openclaw/local_plugin.md
- "(ri:server-line) Hermes 本地插件": openclaw/hermes_local_plugin.md
- "(ri:flask-line) 使用示例":
- "(ri:team-line) 多智能体记忆隔离": openclaw/examples/multi_agent.md
- "(ri:filter-3-line) 记忆召回的二次过滤": openclaw/examples/recall_filter.md
- "(ri:terminal-box-line) Hermes 本地插件使用": openclaw/examples/hermes_usage.md

- "(ri:file-code-line) API文档":
- "(ri:rocket-line) 开始使用":
Expand All @@ -111,6 +117,9 @@ nav:
- "(ri:delete-bin-line) Delete Memory": api_docs/core/delete_memory.md
- "(ri:feedback-line) Add Feedback": api_docs/message/add_feedback.md

- "(ri:cpu-line) 自研模型":
- "(ri:flask-line) Extract Memory": api_docs/core/extract_memory.md

- "(ri:chat-1-line) 消息":
- "(ri:file-list-line) Get Message": api_docs/message/get_message.md
- "(ri:task-line) Get Task Status": api_docs/message/get_status.md
Expand Down Expand Up @@ -139,4 +148,4 @@ nav:
- "(ri:layout-grid-line) 框架与平台":
# - "(ri:chrome-line) 浏览器插件": usecase/frameworks/browser_extension.md
- "(ri:brain-line) Claude MCP": usecase/frameworks/claude_mcp.md
- "(ri:puzzle-2-line) Coze 插件工具": usecase/frameworks/coze_plugin.md
- "(ri:puzzle-2-line) Coze 插件工具": usecase/frameworks/coze_plugin.md
39 changes: 24 additions & 15 deletions content/en/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ nav:
- "(ri:file-code-line) REST API Server": open_source/getting_started/rest_api_server.md
- "(ri:code-line) MemOS Examples": open_source/getting_started/examples.md

- "(ri:cpu-line) MOS":
- "(ri:cpu-line) MemOS":
- "(ri:eye-line) API Development Guide": open_source/modules/mos/overview.md
- "(ri:checkbox-multiple-blank-line) MemCube": open_source/modules/mem_cube.md
- "(ri:book-open-line) MemReader": open_source/modules/mem_reader.md
Expand Down Expand Up @@ -83,22 +83,28 @@ nav:
- "(ri:file-code-line) API Reference": api-reference/search-memories

- "(ri:robot-line) Openclaw":
- "(ri:book-open-line) Cloud Plugin vs Local Plugin": openclaw/plugin_compare.md
- "(ri:file-list-3-line) Changelog": openclaw/changes.md
- "(ri:download-line) Installation Guide":
- "(ri:cloud-line) OpenClaw Cloud Plugin": openclaw/guide.md
- "(ri:computer-line) OpenClaw Local Plugin": openclaw/local_plugin.md
- "(ri:flask-line) Usage Examples":
- "(ri:team-line) Multi-Agent Memory Isolation": openclaw/examples/multi_agent.md
- "(ri:filter-3-line) Secondary Filtering for Memory Recall": openclaw/examples/recall_filter.md
- "(ri:book-open-line) Cloud Plugin vs Local Plugin":
- "(ri:file-code-line) Usage Examples": self_developed_model/extraction_usage_example.md

- "(ri:puzzle-line) MCP and Agent Framework Support":
- "(ri:tools-line) MCP Services":
- "(ri:robot-line) Openclaw":
- "(ri:book-open-line) Cloud Plugin vs Local Plugin":
- "(ri:book-open-line) Guide": mcp_agent/mcp/guide.md

- "(ri:robot-line) Agent Development":
- "(ri:file-list-3-line) Changelog":
- "(ri:book-open-line) Guide": mcp_agent/agent/guide.md

- "(ri:robot-line) Agent":
- "(ri:tools-line) MCP Services": openclaw/plugin_compare.md
- "(ri:robot-line) Agent Development": openclaw/changes.md
- "(ri:chat-1-line) Messages":
- "(ri:file-list-line) Get Message": openclaw/guide.md
- "(ri:task-line) Get Task Status": openclaw/local_plugin.md
- "(ri:server-line) Hermes Local Plugin": openclaw/hermes_local_plugin.md
- "(ri:chat-smile-2-line) Chat":
- "(ri:chat-4-line) Chat": openclaw/examples/multi_agent.md
- "(ri:filter-3-line) Secondary Filtering for Memory Recall": openclaw/examples/recall_filter.md
- "(ri:terminal-box-line) Using the Hermes Local Plugin": openclaw/examples/hermes_usage.md

- "(ri:file-code-line) API Documentation":
- "(ri:rocket-line) Get Started":
- "(ri:eye-line) Overview": api_docs/start/overview.md
Expand All @@ -111,6 +117,9 @@ nav:
- "(ri:delete-bin-line) Delete Memory": api_docs/core/delete_memory.md
- "(ri:feedback-line) Add Feedback": api_docs/message/add_feedback.md

- "(ri:cpu-line) Self-Developed Model":
- "(ri:flask-line) Extract Memory": api_docs/core/extract_memory.md

- "(ri:chat-1-line) Messages":
- "(ri:file-list-line) Get Message": api_docs/message/get_message.md
- "(ri:task-line) Get Task Status": api_docs/message/get_status.md
Expand All @@ -134,9 +143,9 @@ nav:
- "(ri:money-dollar-circle-line) Financial Assistant": usecase/financial_assistant.md
- "(ri:edit-line) Writing Assistant": usecase/writting_assistant.md
- "(ri:heart-line) Life Assistant": usecase/home_assistant.md
# - "(ri:customer-service-2-line) WeCom Customer Service": usecase/wecom_customer_service.md
# - "(ri:customer-service-2-line) 企微客服": usecase/wecom_customer_service.md

- "(ri:layout-grid-line) Frameworks & Platforms":
# - "(ri:chrome-line) Browser Extension": usecase/frameworks/browser_extension.md
# - "(ri:chrome-line) 浏览器插件": usecase/frameworks/browser_extension.md
- "(ri:brain-line) Claude MCP": usecase/frameworks/claude_mcp.md
- "(ri:puzzle-2-line) Coze Plugin Tools": usecase/frameworks/coze_plugin.md
- "(ri:puzzle-2-line) Coze Plugin Tools": usecase/frameworks/coze_plugin.md
Loading