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 (by a 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.
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.