Browser Extension
The popup
Section titled “The popup”Click the toolbar icon to open the popup. The header shows the current site and a gear button for the settings page. Below it, the provider chip names the provider and model and shows whether it is reachable (green) or not (red; click it to fix the setup).
| Control | What it does |
|---|---|
| Translate into | Language picker with every common language by name (in your UI language and its own name), plus Other language… for any code or name the model understands. |
| Recent languages | Up to four recently used languages as chips; a click translates right away. |
| Translate to … | Scans the page, applies stored translations and requests only the missing strings from the selected provider. |
| Progress | Translating to German · 12 / 40 with a Stop button. Stopping keeps what is already translated. Closing the popup does not interrupt the translation. |
| Show original | Restores every original string. Picking another language translates into it instead. |
| Always translate site | Translates the site automatically on every visit, in the selected language. |
| Keys and files | Collapsed by default: Scan page, Apply stored, Export keys, Import, and the list of keys with their source text. |
The toolbar icon shows the language code (for example DE) while a page is translated and … while a
translation runs.
Keyboard shortcut
Section titled “Keyboard shortcut”Alt+Shift+T translates the current page into the site’s
auto-translate language or the language used last, and restores the original when pressed again
(it also stops a running translation). Change it on chrome://extensions/shortcuts (Firefox:
about:addons → gear → Manage Extension Shortcuts), or from the settings page.
Progress on the page
Section titled “Progress on the page”Every visible translation, wherever it was started, shows a small pill at the bottom of the page with the progress and a Stop button. It turns into a short confirmation when the translation is done. Text that appears later (dynamic content) is translated quietly without the pill.
The settings page
Section titled “The settings page”The gear button in the popup (or Extension options in the browser’s extension menu) opens the settings page. Changes are saved immediately.
| Section | Settings |
|---|---|
| Translation provider | Provider, endpoint URL, model (with suggestions from the provider), API key, strings per request, parallel requests, Test connection |
| Image translation | Built-in OCR with its languages, or a vision-model endpoint, model and key |
| On the page | Show the original text on hover; underline translated text |
| Stored translations | Totals, and Delete all translations |
The UI follows the browser language (English or German) and the system light or dark theme.
Context menu
Section titled “Context menu”- Translate page translates the page into the site’s auto-translate language, or else the language used last.
- Translate image text (on images) reads and translates the text in the image; see Image translation.
Comparing with the original
Section titled “Comparing with the original”Hovering translated text for a moment shows the original in a tooltip. Turn on Underline translated text to mark everything that was translated with a dashed underline.
The floating toolbar
Section titled “The floating toolbar”Every page also gets a small draggable circle in the bottom-right corner (a globe button). It lives
in a closed shadow root with :host { all: initial }, so the host page’s CSS cannot affect it and
its own CSS cannot leak out. Clicking it opens a compact panel with a language field, a
Translate / Revert button, an Auto: <lang> indicator when auto-translate is on, and a
status line.
The language field accepts codes and names (de, German, Deutsch) and is pre-filled with the
language used last. Turn the button off with Show the floating translate button on pages on the
settings page.
Typical flows
Section titled “Typical flows”With a model
Section titled “With a model”- Pick a provider on the settings page and press Test connection (on first install the settings page offers the LM Studio or Ollama it finds).
- Open the page, click the toolbar circle or the extension popup (or right-click → Translate page).
- Enter a language code and press Translate.
- Text is replaced batch by batch as results arrive.
- Press Revert to restore the page.
Strings the site already has a translation for are applied immediately and never sent again. With the any-i18n server as provider, the server’s SQLite cache adds a second, cross-site layer.
Fully manual (no server)
Section titled “Fully manual (no server)”- Open the page, then Keys and files in the popup.
- Press Export keys to download
_keys.json. - Translate the
keysobject into a translation file (by hand, or withany-i18n translate). - Press Import and select that file.
- Press Apply stored (the picker switches to the imported language).
An imported file must contain _meta.domain, _meta.language, and a translations object;
otherwise the import is rejected with a format error. See
File Formats.
Shipping translations inside the extension
Section titled “Shipping translations inside the extension”Put translation files under extension/translations/<domain>/<lang>.json and list the domains in
extension/translations/manifest.json:
{ "_meta": { "version": "1.0.0", "description": "Translation manifest for any-i18n" }, "domains": { "example.com": { "languages": ["de", "fr"], "lastUpdated": "2026-01-15T11:00:00.000Z" } }}The service worker fetches that manifest on install and on every startup and indexes the listed
files into browser.storage.local, so bundled translations behave exactly like imported ones. A
missing or empty manifest is not an error — the shipped one has no domains.
Auto-translate
Section titled “Auto-translate”Toggling Always translate site stores { language, enabled: true } for the hostname. On the
next load the content script:
- scans the page,
- applies whatever is already cached for that language,
- sends the still-untranslated keys to the provider, and
- applies each partial result as it arrives.
Changing the language field while the toggle is on updates the stored language.
What gets translated
Section titled “What gets translated”- Visible text nodes with at least
MIN_TEXT_LENGTH(2) characters titleandaria-labelon any elementplaceholderon<input>and<textarea>alton<img>valueon<input type="submit|button|reset">
Ignored: SCRIPT, STYLE, NOSCRIPT, IFRAME, SVG, META, LINK, HEAD, TITLE,
TEXTAREA, any subtree marked translate="no", editable (contenteditable) content, and strings
made only of digits, punctuation, or symbols.
Text added after the page was translated is picked up by the MutationObserver, and its keys are
requested from the provider about a second later (each key once per page).
Layout safety
Section titled “Layout safety”Translations are usually longer than the source. Two mechanisms limit the damage:
- the server annotates each string with a target maximum length and asks for concise phrasing (server provider only)
- translated elements receive
data-anyi18nand a defensive stylesheet withoverflow-wrap,word-break,white-space: normal, andmin-width: 0
Reverting removes the marker attributes again.
Permissions
Section titled “Permissions”| Permission | Why |
|---|---|
storage |
Settings, stored translations, auto-translate sites |
activeTab, scripting |
Inject the content scripts into tabs opened before installation |
contextMenus |
Translate page and Translate image text |
offscreen |
Run the bundled OCR engine (Chrome and Edge) |
http://localhost/*, http://127.0.0.1/*, https://*/* |
Reach local and hosted providers, and load images for OCR |
http://*/* (optional) |
Plain-HTTP providers on other machines; requested only when you test such an endpoint |
Content scripts run on every http and https page at document_idle. Page text is sent only to the
provider you configured.