translate_page
Translate a page's locale files into multiple languages by reading the English source and generating translations for Chinese, Japanese, French, and German.
Instructions
Translate a specific page's locale files. Use this when user says 'i18n翻译{pageName}页面'. Reads from {basePath}/{pageName}/en-US/ and creates translations in zh-CN, ja-JP, fr-FR, de-DE directories.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pageName": "<pageName>",
"basePath": "<basePath>"
},
"name": "translate_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Qwen model to use (default: qwen-turbo) | qwen-turbo |
| apiKey | No | DashScope API key (optional, can use env var DASHSCOPE_API_KEY) | |
| basePath | Yes | Base path to locale directory (e.g., '/packages/web/src/locale') | |
| pageName | Yes | Name of the page to translate (e.g., 'mockupA') | |
| incremental | No | Only translate new/modified keys (default: true) | |
| sourceLocale | No | Source locale code (default: en-US) | en-US |
| targetLocales | No | Target locale codes (default: zh-CN, ja-JP, fr-FR, de-DE) |