ワンクリックで
i18n-translator
AI-powered multi-language website translation with text extraction, Gemini translation, and language switcher.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
AI-powered multi-language website translation with text extraction, Gemini translation, and language switcher.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Open local review artifacts in Xiaoer Omia when users ask to open, preview, inspect, or review a file.
Run a measured improvement loop for a skill by defining a yes/no checklist, capturing a baseline, scoring candidate outputs, and logging each iteration's keep/revert decision. Use when a skill works inconsistently and you want evidence-driven iteration instead of random prompt edits.
Build a static HTML report site from CSV, JSON, Markdown, or HTML inputs. Use when the user wants to turn existing data into a human-readable site, generate a data showcase page, create a static report website, or optionally publish the built site.
Add offline multilingual support to static HTML, small web projects, or reports by extracting text into tokens, maintaining language dictionaries, applying translated outputs, and optionally embedding a local language switcher. Use when the user asks for bilingual support, tokenizing Chinese copy, offline language switching, or i18n for reports and lightweight sites.
Unified entrypoint for Obsidian note operations such as cleanup, merge, lint/fix, meeting archive, daily rollover, and docs sync. Use when the user wants one command surface over an existing notes-tools repo instead of calling many atomic scripts by hand.
Test, tune, and regression-check LLM system prompts with a golden dataset. Use when the user wants to optimize a prompt, run prompt regression tests, manage `cases.yaml`, compare expected vs actual outputs, or follow a TDD workflow for prompts.
| name | i18n-translator |
| description | AI-powered multi-language website translation with text extraction, Gemini translation, and language switcher. |
| version | 1.1.0 |
| author | Vivi |
| tags | ["i18n","translation","html","multilingual"] |
| platforms | ["all"] |
| dependencies | ["python3","pip (google-generativeai)"] |
Transforms Chinese HTML/web content into multiple languages with one command.
pip install google-generativeai
export GEMINI_API_KEY="your-key" # Get from https://aistudio.google.com/app/apikey
# All languages
./translate-all.sh ~/project
# Selected languages
./auto-translate.sh ~/project "en-US,ja-JP,ko-KR"
| Script | Usage | Description |
|---|---|---|
translate-all.sh | ./translate-all.sh <dir> [out] | Translate to all 6 languages |
auto-translate.sh | ./auto-translate.sh <dir> [langs] [out] | Translate to selected languages |
| Command | Usage | Description |
|---|---|---|
extract | python3 main.py extract --root <dir> --lang zh-CN --write | Extract text, replace with tokens |
apply | python3 main.py apply --root <dir> --lang en-US --out-dir <out> | Generate translated version |
embed-switch | python3 main.py embed-switch --html <file> --root <dir> --langs zh-CN,en-US | Add language switcher |
translate | python3 translate.py --root <dir> --targets "en-US,ja-JP" | AI-translate dictionaries |
| Option | Description |
|---|---|
--dry-run | Preview without writing files |
--batch-size N | Texts per API call (default: 20) |
--ext .html | File extensions to scan (repeatable) |
| Env Variable | Required | Description |
|---|---|---|
GEMINI_API_KEY | Yes | Gemini API key |
Source HTML (Chinese)
-> extract --write
Tokenized HTML + i18n/zh-CN.json
-> translate.py
i18n/en-US.json, i18n/ja-JP.json, ...
-> apply --out-dir
Translated HTML versions
Warning:
extract --writemodifies source files in-place (Chinese text -> tokens). Always backup first.
project/
├── index.html # Tokenized (after extract)
├── i18n/
│ ├── zh-CN.json # Chinese dictionary
│ ├── en-US.json # English dictionary
│ └── ja-JP.json # Japanese dictionary
project__multilang__en-US/
└── index.html # English version
project__multilang__ja-JP/
└── index.html # Japanese version
| Code | Language |
|---|---|
en-US | English |
ja-JP | Japanese |
ko-KR | Korean |
es-ES | Spanish |
fr-FR | French |
de-DE | German |
Custom languages: python3 translate.py --root <dir> --target th-TH
API key error?
echo $GEMINI_API_KEY — ensure it's set. Get one at https://aistudio.google.com/app/apikey
Output dir already exists? The tool auto-removes existing output. If issues persist, delete manually.
HTML attributes not translated?
data-*, aria-label, title, placeholder attributes need manual replacement via sed. See examples/ for patterns.
Rate limited?
Reduce batch size: python3 translate.py --root <dir> --targets en-US --batch-size 5