openclaw-i18n — Internationalization Layer for OpenClaw
What This Skill Does
OpenClaw is a powerful AI agent framework — but by default, models generate
output that often has wrong diacritics, mixed languages, or mechanically garbled
text when users communicate in non-English languages. This skill fixes that
with two layers:
Layer 1 — SKILL.md: Configures the agent to think and respond correctly
in the user's language. Language detection, diacritics enforcement, locale
formatting, cultural communication norms.
Layer 2 — Post-Processor: A Python script that mechanically cleans the
model's raw output before it reaches the user. This is the unique part — no
other ClawHub skill does this. It catches the specific mechanical errors that
models reliably produce on non-English text: missing diacritics, stray
Chinese/Russian characters, merged words, common typos.
Language Detection
How It Works
- - Auto-detect user language from conversation context
- Signals: explicit language statements, user names, place references, writing
style, diacritic usage
- - Confidence scoring — if below 80%, ask the user to confirm
Supported Languages
| Language | Code | Status | Diacritics | Launch |
|---|
| Romanian | ro | Stable | ă â î ș ț | v1.0 |
| German |
de | Stable | ü ö ä ß | v1.0 |
| French | fr | Planned | à â ç é è ê ë î ï ô û ü | v1.1 |
| Spanish | es | Planned | á é í ó ú ñ ü ¿ ¡ | v1.1 |
| Italian | it | Planned | à è é ì ò ó ù | v1.2 |
| Portuguese | pt | Planned | à á â ã ç é ê í ó ô õ ú | v1.2 |
English (en) is always the fallback when detection fails.
Configuration Commands
CODEBLOCK0
Configuration persists across sessions via OpenClaw memory tools.
Output Rules
Language Enforcement
- - Always respond in the detected or configured language
- Never switch languages mid-response without explicit reason
- If a user writes in Romanian, respond in Romanian — never English
- If a user writes in German, respond in German — never English
Character Rules
- - Never output Chinese, Russian, Arabic, or non-Latin characters in
non-intentional contexts. Stray characters that appear in Romanian or German
output are model errors — the post-processor removes them.
- - Words are always separated by correct spaces — never merge two words
into one. Example: "sivei" should never appear as "știu" split wrongly.
- - Always use correct diacritics for the active language
Diacritics — Never Approximate
Romanian: ă â î ș ț — always correct, never write "s" instead of "ș" or
"t" instead of "ț" in Romanian words.
German: ü ö ä ß — never substitute with "ue", "oe", "ae" unless user
explicitly asks for old spelling.
What NOT To Do
- - No filler phrases: "Desigur!", "Absolut!", "With pleasure!"
- No language mixing: English sentence fragments in a Romanian response
- No transliteration of diacritics: never write "sch" for "ș" in Romanian
- No "obviously", "of course", "as you know" — condescending patterns
Locale-Specific Formatting
Romanian (RO)
| Element | Format |
|---|
| Date | 15 martie 2026 |
| Currency |
150 lei / 30 euro / 29,99 € |
| Phone | +40 734 270 188 / 0721 234 567 |
| Address | Strada Victoriei nr. 10, București |
German (DE)
| Element | Format |
|---|
| Date | 15. März 2026 / 15.03.2026 |
| Currency |
29,99 € / 150 € |
| Phone | +49 30 12345678 / 0171 2345678 |
| Address | Hauptstraße 10, 10115 Berlin |
Cultural Communication Norms
German (DE) — Formal by Default
- - Use Sie (capitalized) unless the user explicitly switches to du
- Formal address: "Sie" not "du", "Ihnen" not "dir"
- Titles: Herr, Frau, Dr. are relevant in professional contexts
- Email tone: structured, clear subject lines, bullet points appreciated
- When in doubt: over-formal beats casual
Romanian (RO) — Warm but Professional
- - First name basis is standard once rapport is established
- Direct communication — say what you mean
- Professional but not stiff — Romanians appreciate warmth
- Avoid: excessive formality, bureaucratic language, impersonal templates
Post-Processor Integration
The i18n_processor.py script runs after the model generates output and
before it reaches the user. This is critical — it fixes mechanical errors
that slip through even when the model "knows" the correct form.
What the Post-Processor Fixes (deterministic, high-confidence):
- 1. Missing diacritics in common words (RO: "vrau"→"vreau", DE: "Mueller"→"Müller")
- Stray non-Latin characters — single Chinese/Russian chars inserted by M2.7
- Merged words — obvious cases where two words lost their space
- Whitespace errors — double spaces, trailing/leading spaces
- Common typos — model-specific patterns that are consistent and fixable
What the Post-Processor Does NOT Fix:
- - Grammar errors requiring context understanding
- Wrong word choice (semantic errors)
- Stylistic improvements
- Sentence structure problems
Integration Instructions
The agent should pipe output through the processor:
CODEBLOCK1
Invoking from SKILL.md Context
When this skill is active, every model response should be treated as raw
output and passed through
process(response, detected_language) before
delivery. The agent never sees this step — it's transparent to the user.
Configuration Memory
Language preference is stored via OpenClaw memory tools:
- - Key:
i18n_language — the active language code (e.g., "ro", "de") - Key:
i18n_mode — "auto" or "manual" - Key:
i18n_detection_confidence — last confidence score (0.0–1.0)
When i18n_mode is "auto", the agent re-evaluates language on each session
start but respects manual overrides until reset.
Quick Reference
| Command | Effect |
|---|
| "Set language to Romanian" | Lock to RO |
| "Setează limba la română" |
Lock to RO |
| "Stelle Sprache auf Deutsch" | Lock to DE |
| "Reset language to auto-detect" | Back to auto |
| Symbol | Meaning |
|---|
| ă â î ș ț | Romanian diacritics |
| ü ö ä ß |
German diacritics |
| 🌐 | Language indicator |
| 🌍 | i18n skill active |
Error Handling
If the post-processor encounters ambiguous text:
- - Do not change if confidence < 95%
- Log the case for review
- Never risk a false positive that makes output worse
Rule: The cost of a missed diacritic is lower than the cost of a wrong one.
openclaw-i18n — OpenClaw 国际化层
该技能的功能
OpenClaw 是一个强大的 AI 智能体框架——但默认情况下,当用户使用非英语语言交流时,模型生成的输出经常出现变音符号错误、语言混杂或文本机械性乱码的问题。本技能通过两层机制解决这一问题:
第一层 — SKILL.md: 配置智能体以用户的语言正确思考和回复。包括语言检测、变音符号强制使用、区域格式、文化沟通规范。
第二层 — 后处理器: 一个 Python 脚本,在模型原始输出到达用户之前对其进行机械性清理。这是独特之处——没有其他 ClawHub 技能能做到这一点。它能捕获模型在处理非英语文本时经常产生的特定机械性错误:缺失变音符号、残留的中文/俄文字符、单词粘连、常见拼写错误。
语言检测
工作原理
- - 从对话上下文中自动检测用户语言
- 信号:明确的语言表述、用户名、地点引用、写作风格、变音符号使用
- 置信度评分——若低于 80%,则请求用户确认
支持的语言
| 语言 | 代码 | 状态 | 变音符号 | 发布版本 |
|---|
| 罗马尼亚语 | ro | 稳定 | ă â î ș ț | v1.0 |
| 德语 |
de | 稳定 | ü ö ä ß | v1.0 |
| 法语 | fr | 计划中 | à â ç é è ê ë î ï ô û ü | v1.1 |
| 西班牙语 | es | 计划中 | á é í ó ú ñ ü ¿ ¡ | v1.1 |
| 意大利语 | it | 计划中 | à è é ì ò ó ù | v1.2 |
| 葡萄牙语 | pt | 计划中 | à á â ã ç é ê í ó ô õ ú | v1.2 |
当检测失败时,英语(en)始终作为回退语言。
配置命令
用户:将语言设置为罗马尼亚语 → 将活动语言设置为 RO
用户:Setează limba la română → 同上
用户:Stelle Sprache auf Deutsch → 将活动语言设置为 DE
用户:将语言重置为自动检测 → 恢复为自动检测
配置通过 OpenClaw 记忆工具跨会话持久化。
输出规则
语言强制
- - 始终以检测到或配置的语言回复
- 除非有明确理由,否则不得在回复中途切换语言
- 如果用户用罗马尼亚语书写,则用罗马尼亚语回复——绝不用英语
- 如果用户用德语书写,则用德语回复——绝不用英语
字符规则
- - 在非有意语境下,绝不输出中文、俄文、阿拉伯文或非拉丁字符。 出现在罗马尼亚语或德语输出中的残留字符属于模型错误——后处理器会将其移除。
- 单词之间始终使用正确的空格分隔——绝不要将两个单词合并为一个。例如:sivei 绝不应错误地拆分为 știu。
- 始终为活动语言使用正确的变音符号
变音符号——绝不近似替代
罗马尼亚语: ă â î ș ț — 始终正确,在罗马尼亚语单词中绝不用 s 代替 ș 或 t 代替 ț。
德语: ü ö ä ß — 除非用户明确要求旧拼写,否则绝不用 ue、oe、ae 替代。
禁止事项
- - 无填充短语:Desigur!、Absolut!、With pleasure!
- 无语言混杂:罗马尼亚语回复中出现英语句子片段
- 无变音符号音译:罗马尼亚语中绝不用 sch 代替 ș
- 无 obviously、of course、as you know 等居高临下的表达模式
区域特定格式
罗马尼亚语(RO)
150 lei / 30 euro / 29,99 € |
| 电话 | +40 734 270 188 / 0721 234 567 |
| 地址 | Strada Victoriei nr. 10, București |
德语(DE)
| 元素 | 格式 |
|---|
| 日期 | 15. März 2026 / 15.03.2026 |
| 货币 |
29,99 € / 150 € |
| 电话 | +49 30 12345678 / 0171 2345678 |
| 地址 | Hauptstraße 10, 10115 Berlin |
文化沟通规范
德语(DE)— 默认正式
- - 使用 Sie(大写),除非用户明确切换到 du
- 正式称呼:Sie 而非 du,Ihnen 而非 dir
- 头衔:Herr、Frau、Dr. 在专业语境中相关
- 邮件语气:结构清晰、主题明确、要点列表受欢迎
- 不确定时:过于正式优于随意
罗马尼亚语(RO)— 热情但专业
- - 一旦建立融洽关系,直呼其名是标准做法
- 直接沟通——直抒胸臆
- 专业但不刻板——罗马尼亚人欣赏热情
- 避免:过度正式、官僚语言、非个性化模板
后处理器集成
i18n_processor.py 脚本在模型生成输出之后、到达用户之前运行。这一点至关重要——它能修复即使模型知道正确形式时仍会出现的机械性错误。
后处理器修复的内容(确定性、高置信度):
- 1. 常见单词中缺失的变音符号(RO:vrau→vreau,DE:Mueller→Müller)
- 残留的非拉丁字符——M2.7 插入的单个中文/俄文字符
- 单词粘连——两个单词失去空格的明显情况
- 空白字符错误——双空格、尾部/前导空格
- 常见拼写错误——模型特定的、一致且可修复的模式
后处理器不修复的内容:
- - 需要上下文理解的语法错误
- 错误用词(语义错误)
- 风格改进
- 句子结构问题
集成说明
智能体应通过处理器管道输出:
python
from i18n_processor import process
cleaned = process(rawoutput, languagecode)
将 cleaned 发送给用户
从 SKILL.md 上下文中调用
当此技能激活时,每个模型响应都应视为原始输出,并在交付前通过 process(response, detected_language) 处理。智能体从未看到此步骤——它对用户是透明的。
配置记忆
语言偏好通过 OpenClaw 记忆工具存储:
- - 键:i18nlanguage — 活动语言代码(例如 ro、de)
- 键:i18nmode — auto 或 manual
- 键:i18ndetectionconfidence — 上次置信度评分(0.0–1.0)
当 i18n_mode 为 auto 时,智能体在每次会话开始时重新评估语言,但在重置之前尊重手动覆盖。
快速参考
| 命令 | 效果 |
|---|
| 将语言设置为罗马尼亚语 | 锁定为 RO |
| Setează limba la română |
锁定为 RO |
| Stelle Sprache auf Deutsch | 锁定为 DE |
| 将语言重置为自动检测 | 恢复为自动检测 |
| 符号 | 含义 |
|---|
| ă â î ș ț | 罗马尼亚语变音符号 |
| ü ö ä ß |
德语变音符号 |
| 🌐 | 语言指示器 |
| 🌍 | i18n 技能激活 |
错误处理
如果后处理器遇到歧义文本:
- - 若置信度 < 95%,则不更改
- 记录案例以供审查
- 绝不冒险因误报而使输出更差
规则:遗漏变音符号的代价低于错误变音符号的代价。