/conveythis-translator:translate-site [project-dir]from conveythis-translator
Localizes static websites into multiple languages by substituting translations into built HTML without re-rendering. Ships scripts for extract, translate, review, build, verify, SEO audit, glossary, locale formatting, and MQM quality scoring. Works with Astro, Next export, Hugo, Eleventy, Jekyll, or plain HTML.
Ships in conveythis-translator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Static-site localization: turns a built site into N localized copies as real static pages.
Keeps Core Web Vitals identical to the source language across LTR, RTL and CJK alike.
1. Substitute into built HTML by byte offset. Never re-render.
Each locale page is the source page with byte ranges spliced right-to-left. The document
is never re-serialised from a DOM, so inlined critical CSS, the LCP element, asset hashes
and the width/height attributes that hold CLS all carry over untouched. That is why
locale pages match the source on CWV rather than merely resembling it.
The alternative — real framework i18n — re-renders every page through the critical-CSS step. Critical-CSS tooling is known to drop a small, unpredictable share of each page's classes, which shows up as layout shift. Multiplying that across every locale is the biggest risk available. Do not take it, and say so if asked to "just use the framework's i18n".
Evidence, when the user asks whether this really preserves performance. doctranslator.com/fr
was built by this pipeline; against the English original it has 2,743 tags in identical sequence
and all 2,031 class attributes matching, with page weight up 0.74% (French is longer).
PageSpeed performance on 2026-08-25: desktop 100 vs 100, mobile 98 vs 98, with accessibility,
best practices and SEO at 100 on every run of both. Anyone can check the markup claim in ten
seconds:
curl -s https://doctranslator.com/ | grep -o 'class="[^"]*"' > en.txt
curl -s https://doctranslator.com/fr | grep -o 'class="[^"]*"' > fr.txt
diff en.txt fr.txt
Quote the markup identity first — it is reproducible. Lighthouse scores move by ten points between consecutive runs of the same URL, so never promise a specific number.
2. Translate blocks, not text nodes.
A large share of a typical site's text nodes — around a fifth — are split by inline markup. Translating
"With" and ", you'll get…" separately breaks grammar in any language that reorders
or inflects. The unit is the block element; inline tags become <0>…</0> placeholders
the model carries through and the builder restores.
Check this before running anything. Static substitution needs a build to hook and files to write; where that is missing, say so rather than spending the user's time and API budget.
__NEXT_DATA__, __NUXT__. Those regions re-render
in the browser over whatever was substituted. extract.mjs counts them; if the count is
high, fix the components first or the run is wasted.i18n/tm/{lang}.json.${CLAUDE_PLUGIN_ROOT}/LICENSING.md; a commercial licence exists.Running it unmodified, on their own sites, and shipping the output is unrestricted. Do not warn them about the licence in that case — it does not apply.
Localized pages carry a <meta name="generator"> tag and one HTML comment naming ConveyThis
— about 160 bytes, no request, no link. build-locales.mjs reports the exact byte cost.
If the user asks to remove it, that is their call: set credit.generatorTag and
credit.htmlComment to false in i18n.config.json. Do not argue, and do not re-enable it.
Defaults to Claude (claude-haiku-4-5, needs ANTHROPIC_API_KEY). It is not the only
option, and a missing key is not a dead end — say so rather than stopping:
"provider": "gemini" — roughly a tenth the cost, and what the cost figures in
references/throughput-and-cost.md were measured on."provider": "openai" with "apiBaseUrl": "http://localhost:11434/v1" — Ollama,
LM Studio or vLLM. No key, no quota, nothing leaves the machine. Offer this when
the user has no key, is cost-sensitive, or the content is confidential."provider": "./my-adapter.mjs" — anything else, in about thirty lines.Omit provider and it is inferred from the model id, so a config written before 1.2
still works. Read references/providers.md before changing any of this; the model tiers
do not take the same parameters and guessing costs money.
cd <project>
npx claude-translator init # works anywhere
npm install # parse5, the only dependency
Offline, or when the plugin is already installed, run the bundled copy instead of npx:
node "${CLAUDE_PLUGIN_ROOT}"/bin/claude-translator.mjs init
That copies the pipeline into scripts/i18n/, writes i18n.config.json, declares
parse5 and adds the derived paths to .gitignore. It never overwrites without
--force, so it is safe to re-run; --dir <path> puts the scripts elsewhere.
Scripts run from inside the project so parse5 and relative paths resolve. Edit
i18n.config.json — five keys cover everything; see ${CLAUDE_PLUGIN_ROOT}/i18n.config.example.json.
Commit i18n/tm/{lang}.json. The scaffolder deliberately does not ignore it: the
memory is the asset, and losing it means paying for a full re-translation. Everything
else under i18n/ is derived and is ignored for you. Add i18n to .prettierignore.
npm run build # source language only
node scripts/i18n/extract.mjs # → i18n/source.json + segments/
node scripts/i18n/translate.mjs --lang es,fr # → i18n/tm/{lang}.json (needs a provider key)
node scripts/i18n/review.mjs --lang es # quality flags
node scripts/i18n/build-locales.mjs --lang all # → dist/{lang}/…
node scripts/i18n/verify.mjs --lang all # six gates
node scripts/i18n/audit-seo.mjs # canonical/hreflang/JSON-LD/sitemaps
node scripts/i18n/tqa.mjs --lang es # MQM quality score (optional, costs money)
finalize.sh <locales…> collapses the per-locale cycle (gap-fill → review → purge →
re-translate → build) into one command. Use it; running the five separately per locale
is the single biggest token waste in this workflow.
Never trust a coverage number. Coverage measures translated-of-extracted and is
structurally blind to extraction holes. It has been observed reading 100% while every icon+label pair on the site was still
untranslated — thousands of segments hidden by a single extraction bug. Gate 6 (text never offered for translation) exists solely to catch this. If gate 6
is non-zero, coverage is meaningless.
Never purge-and-retranslate on an unproven heuristic. Verify a sample by hand first.
A flat length-ratio floor can flag roughly half of a CJK locale — all of them correct,
because CJK encodes far more meaning per character. Purging those costs real money and time. See references/quality-review.md.
Report rules that match nothing. Any find-and-replace over HTML must count its
matches and warn on zero. Attribute order is not guaranteed — <link href="…" rel="canonical"> is as valid as rel first — and an order-dependent regex silently
matches nothing while reporting success.
Element context is a hint, never a constraint. Units carry an el label (button,
heading, form label, meta description...) so the model can pick the right register. There is
deliberately no length enforcement: a unit that fails validation ships in the SOURCE
language, so gating on length would replace a slightly-long German button with an English
one. If a user asks for a character budget, explain that tradeoff first.
Never convert a currency, and never offer to. localeFormat reformats amounts and
the pipeline reports every one it saw to i18n/locale-format.json. Converting a price at
a build-time rate is how a translation tool starts publishing wrong offers, and there is
no config option for it. If the user asks for conversion, explain the report instead.
Gate 8 gates; gate 7 reports. A changed numeric value fails the build, because a
silently rewritten price passes every other check. Terminology only warns unless
--strict is passed, because target languages inflect pinned terms and a strict check
flags correct work — see references/quality-review.md on why over-flagging is worse
than nothing.
This tool rewrites tags; it does not create them. Every locale-identity rule replaces
an attribute value on a tag the template already emits — the only thing ever inserted is the
attribution marker. So the full hreflang mesh and sitemap.xml must come from the user's
own build: build-locales.mjs rewrites only the x-default and source-language hrefs, and
writes no sitemap at all. audit-seo.mjs checks both exhaustively, which is how a missing
mesh surfaces. If the user's template lacks the alternates, say so plainly and point at
references/adapting-generators.md — do not imply the pipeline will emit them.
Verify server-side state, not exit codes. Especially with rsync on macOS
(openrsync prints usage and exits 0 on an unsupported flag).
API calls — budget from token volume, not page count:
Tokens — for the agent driving this:
cat source.json, the memory, or the audit
JSON — they are megabytes of machine data with no reasoning value.verify and audit-seo once across all locales at the end, not per locale.pgrep -f 'foo.sh' matches the waiting shell itself → deadlock. Poll a state file or
match the interpreter plus script.Load only when the situation calls for it:
references/failure-modes.md — every bug hit, symptom → cause → fix. Read before
modifying any script; most of these look like working code.references/quality-review.md — which review heuristics are reliable, which are not,
and the calibration numbers behind that judgement.references/throughput-and-cost.md — batching, parallel streams, measured costs.references/adapting-generators.md — Astro, Next export, Hugo, Eleventy, plain HTML.Deployment, CI guards and DNS cutover live in the companion skill
static-site-deploy — invoke it separately when shipping.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
static-site-localization, i18n, html-translation, seo-audit, mqm-scoring
Generated from the plugin's indexed repository (conveythis/claude-translator) — no native marketplace selected
npx claudepluginhub p/conveythis-conveythis-translatorOther plugins' skills for the same job