Multilingual Translation Workflow
If you maintain a multilingual project — documentation, a website, a knowledge base — keeping translations in sync is one of the most tedious tasks imaginable. Moltbot turns it into a single message.
You: Read docs/zh/guide/setup-vps.md, translate it to English,
and write the result to docs/en/guide/setup-vps.mdOne message. Translation plus file write. Done.
Prerequisites
- Moltbot running and connected to Telegram
- File system access — Moltbot needs read/write access to your project's file system (either running on the same server or via a file system MCP tool)
- MCP tools for file operations — A file read/write tool or shell access to create and update files
Why Use Moltbot for Translation?
Traditional translation workflows involve copying text into a translation tool, waiting for results, reviewing, then pasting back. Machine translation APIs give you raw output with no awareness of context, terminology, or formatting conventions.
Moltbot offers several advantages:
- Context-aware translation. The LLM understands markdown formatting, code blocks, front matter, and technical terminology. It preserves structure while translating prose.
- Consistent terminology. You can define a glossary in your SOUL.md, and Moltbot will use those terms consistently across all translations.
- One-step execution. Read source, translate, write output — all in a single conversational command.
- Memory of past translations. If you have translated similar content before, Moltbot's memory can help maintain consistency with previous choices.
- Batch operations. You can translate multiple files in one session.
Setup
Step 1: Grant File Access
Ensure Moltbot can read and write files in your project directory. This typically means either:
- Running Moltbot on the same server as your project, with the project directory mounted or accessible
- Using a file system MCP tool that provides read/write capabilities to the target directory
Step 2: Define Translation Rules in SOUL.md (Optional but Recommended)
Add translation guidelines to your SOUL.md for consistent output:
## Translation Guidelines
When translating documentation files:
- Preserve all markdown formatting, frontmatter, and code blocks exactly
- Do NOT translate text inside code blocks or inline code
- Do NOT translate frontmatter field names (only translate values like title and description)
- Keep all file paths, URLs, and command-line examples unchanged
- Use the following terminology:
- "scheduled tasks" (not "cron jobs" or "timed tasks") in Chinese → English
- "memory system" (not "memory module" or "storage") in Chinese → English
- "配置" → "configuration" (not "settings" or "config")Step 3: Translate a Single File
The simplest use case — translate one file:
You: Read docs/zh/guide/setup-vps.md, translate it to English,
and write the result to docs/en/guide/setup-vps.mdMoltbot will:
- Read the source file
- Translate the content while preserving formatting
- Write the translated content to the target path
- Confirm completion
Step 4: Batch Translation
Translate multiple files in sequence:
You: Translate these files from Chinese to English:
- docs/zh/guide/setup-vps.md → docs/en/guide/setup-vps.md
- docs/zh/guide/configuration.md → docs/en/guide/configuration.md
- docs/zh/advanced/memory.md → docs/en/advanced/memory.md
Preserve all formatting and code blocks.Step 5: Automate Translation Checks (Optional)
Set up a cron job to detect untranslated or outdated files:
cron:
- name: translation-check
schedule: "0 9 * * 1"
channel: telegram
prompt: |
Compare the file lists in docs/zh/ and docs/en/.
Identify:
1. Files that exist in zh/ but not in en/ (untranslated)
2. Files where the zh/ version was modified more recently than the en/ version (potentially outdated)
Report the results. If everything is in sync, do NOT send a message.Common Translation Scenarios
Translate and adapt tone:
You: Read docs/zh/guide/quickstart.md and translate it to English.
Make the tone slightly more casual and developer-friendly
compared to a literal translation. Write to docs/en/guide/quickstart.mdTranslate to multiple languages:
You: Read docs/en/guide/setup.md.
Translate it to both Chinese and Japanese.
Write to docs/zh/guide/setup.md and docs/ja/guide/setup.md respectively.Update an existing translation:
You: The file docs/zh/guide/memory.md has been updated.
Read the new Chinese version and the current English version at docs/en/guide/memory.md.
Update the English version to reflect the changes while keeping any English-specific
phrasing that was already good.This is more nuanced than a fresh translation — Moltbot compares both versions and applies targeted updates rather than retranslating from scratch.
Edge Cases and Troubleshooting
- Code blocks with comments: By default, code comments should not be translated. If you want comments translated, specify it explicitly: "Also translate comments inside code blocks."
- Frontmatter handling: YAML frontmatter keys must not be translated, but values like
titleanddescriptionshould be. The SOUL.md rules above handle this, but double-check output on your first few translations. - Large files: Very long documents may approach the LLM's context window limit. If a file is exceptionally long (10,000+ words), consider splitting it or translating section by section.
- Right-to-left languages: If translating to Arabic, Hebrew, or other RTL languages, you may need to add appropriate HTML/CSS direction attributes manually. Moltbot will translate the text but may not automatically add
dir="rtl"markup. - Idiomatic expressions: LLM translation handles idioms reasonably well, but review output for technical content where precision matters. Domain-specific jargon benefits from the glossary in SOUL.md.
- File encoding: Moltbot writes UTF-8 by default, which handles virtually all languages. If your project requires a specific encoding, note that in your instructions.
Pro Tips
- Build a glossary over time. Each time you correct a translation term, add it to your SOUL.md glossary. Over months, this becomes a comprehensive style guide that ensures consistency.
- Use memory for translation context. Before a big translation session, tell Moltbot: "I'm translating the Moltbot docs. The target audience is Chinese developers familiar with cloud infrastructure. Keep technical terms in English when they're commonly used that way (e.g., API, webhook, cron)." Memory retains this context across multiple translation commands.
- Review diffs, not full files. After translation, use
git diffto review what changed. This is much faster than reading the full translated file. - Combine with CI/CD. If your documentation is in a git repo, you can have Moltbot create a branch and commit for each translation update, making it easy to review via pull request.
- Translate user-facing strings. Beyond docs, Moltbot can translate JSON/YAML locale files: "Read locales/en.json and translate all values to German. Write to locales/de.json." This works well for i18n string files.
Related Pages
- Memory System — Retain translation context and glossaries across sessions
- MCP Tools — File system tools for reading and writing files
- Scheduled Tasks — Automate translation freshness checks
- Writing Assistant — Draft and polish multilingual content
- Creative Use Cases — More automation ideas