Scan any page, give every string a deterministic key, translate it with LM Studio, Ollama, OpenAI, DeepSeek or your own server, and swap the text in place.
any-i18n retrofits internationalization onto websites that never had it. A Manifest V3 browser
extension walks the live DOM with a TreeWalker, collects every visible text node and every
translatable attribute, and turns each string into a deterministic key. Those keys can be exported,
translated (directly by an AI model of your choice, by the optional local server, by the CLI, or by
hand), imported back, and applied, replacing text in place while keeping the originals so everything
can be reverted.
Nothing is patched into the website itself: no build step, no source access, no server-side changes.
Plenty of pages you need to read, demo, or hand to a colleague are simply not localized — internal
tools, legacy admin panels, vendor dashboards, documentation that only exists in one language.
Machine page translation gives you a black box with no stable identity for a string. any-i18n gives
each string a reproducible key (prefix_fnv1ahash), so a translation you fix once keeps applying on
every later visit, and the whole translation set is a plain JSON file you own.
TreeWalker DOM scan
Two passes: text nodes, then translatable attributes (title, aria-label, placeholder,
alt, and button-like value). Skips SCRIPT, STYLE, NOSCRIPT, IFRAME, SVG, META,
LINK, HEAD, TITLE, and anything marked translate="no".
Deterministic keys
FNV-1a 32-bit hash of the normalized text, prefixed with its first three words — the same
sentence always produces the same key, on any page and any run.
Reversible in-place rewrite
Originals are kept in a Map, so one click restores the page exactly. Attribute values are
restored too.
SPA aware
A MutationObserver (50 ms debounce) translates content added later, and pushState,
replaceState, popstate, and hashchange are intercepted to handle client-side navigation.
Bring your own model
LM Studio, Ollama, OpenAI, DeepSeek, OpenRouter or any OpenAI-compatible API, called directly
from the extension. Translations are stored per site, so revisits cost no API calls.
Image translation
Right-click an image: the bundled Tesseract OCR (or a vision model) reads the text and your
provider translates it.
Local translation server
A FastAPI service batches keys to a configurable LLM backend, streams results back over SSE,
and caches every translation in SQLite so repeat visits cost nothing.
Node CLI
translate, validate, and bundle for working with exported key files and shipping
translations inside the extension.
Scan — the content script walks document.body and collects text nodes and attributes.
Key generation — each normalized string becomes firstthreewords_fnv1ahash.
Translate — the extension sends keys the site has no translation for to the selected
provider (or the local server), or you export the keys and translate them with the CLI or by hand.
Apply — matching keys are written back into the DOM; originals are remembered.
Stay applied — the MutationObserver applies stored translations to new nodes and requests
the missing ones as the page changes.
Revert — one action restores every original text node and attribute value.