Read foreign-language papers in Zotero 10 with a translation under every paragraph.
Interlinear plugs into the desktop PDF reader's reading mode, fetches a translation for each structured paragraph, and renders it right next to the source — so you can keep reading instead of copying text into a translator.
中文文档 · Changelog · Contributing
- Five built-in translation services. Free Google Translate works out of the box with no API key (rotating several independent quota pools and gateways, then Microsoft Edge, MyMemory and self-hosted LibreTranslate as fallbacks, plus optional Alibaba Cloud or Azure quotas). OpenAI-compatible endpoints, Anthropic Claude, Google Gemini, and Ollama are one settings page away. No companion plugin is required.
- Four layouts. Translation below the source, side-by-side columns, translation only, or source only. A dedicated display-mode button cycles through them; side-by-side keeps the first lines aligned without disturbing Zotero's native highlights.
- One toolbar toggle. The main toolbar button starts a translation run, then shows or hides the result. While a run is in progress, clicking it pauses and hides; clicking again shows the translations and resumes unfinished paragraphs. Each reader keeps its own state.
- Translate as you read. Rest the pointer on a paragraph, press your custom shortcut, Alt-click, or select text — each triggers a single-paragraph translation without starting a full-document run.
- Full-document runs that behave. Progress and cancel from the toolbar, viewport-first ordering that re-sorts as you page, short-paragraph batching, concurrency and rate limits, timeouts, automatic pause after repeated failures, and click-to-retry on any failed paragraph.
- Glossary. Import/export CSV or TSV term lists. Terms are injected into LLM prompts and enforced as a post-translation replacement on every service, including Google.
- Reading assistant. A chat sidebar answers questions about the selected paragraph, the current page, or the whole document (LLM services only).
- Bilingual PDF export. The current source-plus-translation view is re-typeset into a searchable PDF and attached to the Zotero item. The export asks which of the four layouts to use.
- Appearance control with live preview. Six built-in presets (Default, Eye-friendly paper, Academic serif, High contrast, Optimized dark, Minimal) apply in one click and can be undone. Includes a searchable installed-font list with favorites, a font-stack builder with up to six fallbacks, automatic per-language font stacks, a custom HSV color picker (hue/saturation/opacity/RGB/HSL/HEX), separate light/dark colors, recent and saved colors, text decoration (underline/overline/strikethrough with style/thickness/offset), paragraph dividers, ribbon position/width/style, block layout (padding/radius/border/indent/alignment/max width/opacity/source dimming), named presets, and JSON import/export.
- Caching. Translations are cached per service, language pair, and glossary, with a one-click cleanup in settings.
- English and Simplified Chinese UI; errors appear as non-blocking notices inside the reader.
- Linked highlighting. Hover a source paragraph and its translation is tinted. Select part of the source and only the matching sentences of the translation are tinted. The color is yours: Appearance → Hover/selection highlight supports light/dark values, presets and reset.
- Dual pane with linked scrolling. The split-screen toolbar button opens a source-only pane and a translation-only pane, keeps finished and in-progress translations mirrored into the translation pane, and scrolls both panes together so the same paragraph stays in view. Press it again to return to the single-pane layouts.
- Formula and inline formatting. LaTeX (
$...$,$$...$$,\(...\),\[...\]), inline code, URLs and paragraph markers are protected from translation and rendered as math/code instead of leaking raw markers into the text.
Real Zotero 10 windows with a real translation run; the images live in docs/images/inbox/ exactly
as captured. Each pair is the same page and scroll position in the light and dark theme. The demo
paper is Attention Is All You Need (Vaswani et al., arXiv:1706.03762); the translations are
machine-generated and shown for illustration only. The paper is distributed under its arXiv licence
(arXiv non-exclusive distrib 1.0, not a Creative Commons licence) and appears here solely as
documentation of this plugin's UI.
![]() |
![]() |
| Inline — light | Inline — dark |
![]() |
![]() |
| Side-by-side — light | Side-by-side — dark |
![]() |
![]() |
| Split view — light | Split view — dark |
Restart Zotero after installing or updating. The settings pane and the reader toolbar are registered at startup; opening the settings before restarting can show an empty Interlinear pane (the labels are filled in at runtime). One restart is enough.
- Download the latest
interlinear.xpifrom Releases. - In Zotero: Tools → Plugins → gear icon → Install Plugin From File…, then pick the
.xpi. - Restart Zotero if prompted.
Requires Zotero 10 or 11 (desktop). See Acknowledgements if you are coming from the original plugin.
Open Edit → Settings → Interlinear. The page uses five tabs; the save bar and tab strip stay visible while you scroll, and modified fields show an unsaved-changes hint:
- Translation service — pick a backend and fill in its endpoint, model, and API key; choose source and target languages. Each backend has a Test connection button that reports running, success, or the actual failure reason in place.
- Display & interaction — default layout, Alt-click to translate a single paragraph, the single-paragraph shortcut, and optional show/hide and layout-cycle shortcuts with conflict warnings.
- Appearance — live preview, six built-in presets and named presets, installed-font detection and stack builder, color picker with per-theme values, text decoration, paragraph dividers, ribbon, block layout, interface-follow and export appearance. Advanced groups start collapsed.
- Glossary — import/export term files.
- Advanced — translation scope (body/headings/captions/list items/notes), skip trailing pages, speed and reliability knobs, auto-translate on open (off / cache only / always), translation cache usage and cleanup, plus version and project links.
Privacy and keys. Translating sends paragraph text to whichever service you configure — that is unavoidable, so do not translate sensitive documents with a service you do not trust. API keys are a separate story: Interlinear encrypts them with Zotero's OS key store (macOS Keychain, Windows DPAPI, Linux libsecret) and keeps only the
oskv1:ciphertext in Zotero preferences. Keys are never written to logs, cache keys, debug output or exported appearance files, and they are sent in headers rather than URLs. Requests to non-loopback endpoints must use HTTPS unless you explicitly confirm a plain-HTTP host, and credential-bearing requests never follow redirects. Because the encryption key lives in your OS account, a profile copied to another machine or OS user cannot decrypt the stored key — re-enter it there. On Linux without a Secret Service, Interlinear keeps the key for the current session only by default; saving it unencrypted is possible but must be confirmed in the settings page and is then marked as unencrypted. Keys stored as plaintext by 0.6.0 and earlier are encrypted in place on first start, and the plaintext form stays readable until you save the key again.
Under Services → Google you can pick a specific service. The default is
MyMemory; if it fails or is throttled, automatic fallback continues with
Google's it, at, gtx, dict-chrome-ex and firefox-a quota pools, two
built-in alternate Google gateways, any configured Alibaba Cloud or Azure
backends, your custom endpoint, Microsoft Edge's translation endpoint, then a
configured LibreTranslate instance. Choosing Auto rotate starts from the
Google pools instead. A throttled pool is skipped within the same batch instead of failing the paragraph. Most of
these services need no account; Alibaba Cloud and Azure are monthly free
quotas that require your own key (see the last part of this section). You can
also choose the preferred pool, toggle automatic fallback, add extra Google
gateway hosts (each an independent quota pool, up to four), wire in a fully
custom free endpoint via a {text}/{from}/{to} GET template plus a JSON
result path, and see which service is active or cooling down. "Test
connection" uses the current form values without saving first.
The default translate_a/t endpoint carries several paragraphs per request
(about 6× fewer requests than per-paragraph calls) and is paced to one request
per second. Free endpoints throttle by IP, so very large runs may still enter a
cooldown: the run pauses with a countdown and resumes automatically instead of
marking every paragraph as failed. Translated paragraphs are cached. For
consistently large workloads, use a model backend instead.
Microsoft Edge's endpoint is the same one Edge uses for built-in page translation: no account or key, one request per batch, and line breaks are preserved. It is undocumented, so Microsoft may change or block it at any time; Interlinear therefore uses it as a fallback after the Google pools rather than as the primary service.
These two are not keyless: you have to register, activate the service and create a key before Interlinear can call them. The settings page links straight to the right pages:
- Alibaba Cloud Machine Translation — activate the service in the
Machine Translation console, create an
AccessKey in
RAM AccessKey management
(preferably for a RAM user with only
AliyunMTFullAccess), then paste the ID and secret into the settings and save. The standard tier includes 1,000,000 characters per month, up to 5,000 characters per request at 50 QPS, and supports automatic source-language detection. - Azure AI Translator — create a Translator resource in the Azure portal (choose the F0 free tier), copy KEY 1 and the region from the resource's "Keys and Endpoint" page, then fill them in. F0 includes 2,000,000 characters per month with no expiry and takes a whole batch per request; leave Region empty for a global resource.
Keys are encrypted in the OS key store like every other backend, and are never written to logs or URLs. Pinning one of these services without a key reports the missing key immediately instead of sending empty requests.
Privacy: MyMemory adds submitted text to its public translation memory. Alibaba Cloud and Azure also receive the submitted text and apply their own terms. For sensitive documents, prefer a local Ollama model.
The default MyMemory endpoint needs a working connection to api.mymemory.translated.net; pinning or rotating to Google needs translate.googleapis.com (after the Google pools are throttled it also tries the built-in clients5.google.com / translate.google.com hosts); the Microsoft Edge fallback needs edge.microsoft.com; LibreTranslate needs its own endpoint reachable; Alibaba Cloud needs mt.cn-hangzhou.aliyuncs.com and Azure needs api.cognitive.microsofttranslator.com. Interlinear sends every request through Zotero's own HTTP layer (Zotero.HTTP.request), so it uses whatever proxy Zotero uses — there is no separate proxy setting in the plugin, and it cannot bypass Zotero's proxy configuration. Whether Zotero itself follows the system proxy depends on Zotero's network preferences and your OS settings (not independently verified here).
If "Test connection" fails: check that your system proxy or TUN mode is running, try another translation backend (OpenAI-compatible, Claude, Gemini or a local Ollama), and only then consider a mirror address you trust. Failure messages now say which of these is likely — timeout, DNS, refused/reset connection, HTTP status, rate limiting, redirect, or unparsable response.
- Open a PDF in Zotero and switch to reading mode.
- Left-click the Interlinear toolbar icon to start a full-document run. Once translations exist, the same button hides them to show the original, and shows them again; if a run is in progress the first click pauses it, and a paused run resumes when translations are shown again. Right-click the icon for retranslate, cancel, export, and settings.
- The display-mode button next to it cycles the four layouts. Failed or paused paragraphs show a retry affordance — click it to retry just that paragraph.
- While reading, hold Alt and click a paragraph, use your shortcut, or select text to translate just that part. During a full run, these reuse in-flight requests instead of calling the service twice.
- Open the reading assistant from the reader sidebar to ask questions about the selection, the current page, or the whole document; export the bilingual view as a PDF attachment from the toolbar menu.
- Desktop Zotero 10 or 11 only; there is no mobile or Zotero 7 support.
- The plugin relies on Zotero's internal reading-mode interfaces, which are not a public API — a Zotero upgrade may break it until adapted.
- Math formulas are not translated; tables are not translated cell-by-cell; figure content is not extracted.
- Scanned PDFs work only as well as Zotero's own text layer.
- Export re-typesets the reading view; it does not overlay translations on the publisher's original PDF pages.
- Default pair is English → Simplified Chinese; other pairs depend on the chosen service and model.
Planned, not implemented, no committed timeline:
- Cell-level table translation.
- Adapting to reading-mode interface changes in future Zotero releases.
npm install
npm run build # type-check + package .scaffold/build/interlinear.xpi
npm run lint:check # ESLint
npm run test:unit # Node unit tests, no Zotero needed
npm run test:gui # capture real preference-window screenshots into docs/dev/screenshots
npm run test:e2e # provider e2e: mock protocols by default
npm start # dev server; set ZOTERO_PLUGIN_ZOTERO_BIN_PATH in .env firstIntegration tests run against a real headless Zotero:
ZOTERO_PLUGIN_ZOTERO_BIN_PATH="/path/to/zotero" npm run test:review
# or the standard scaffold entry:
ZOTERO_PLUGIN_ZOTERO_BIN_PATH="/path/to/zotero" npm testnpm run test:e2e also covers a real local Ollama model and a real Google
request through a local proxy when the matching environment variables are set:
INTERLINEAR_TEST_OLLAMA_MODEL=qwen2.5:7b INTERLINEAR_TEST_GOOGLE_PROXY_PORT=7897 \
ZOTERO_PLUGIN_ZOTERO_BIN_PATH="/path/to/zotero" npm run test:e2eOn Windows the path is typically C:\Program Files\Zotero\zotero.exe. CI runs lint, builds on Ubuntu/macOS, and executes the test suite on every push to main.
Interlinear is based on quillamio/bilingual-reader (AGPL-3.0-or-later); adapted contributions and template sources are recorded in NOTICE.md. If you used the original Bilingual Reader, uninstall it before installing Interlinear — your old settings and translation cache are copied into Interlinear's own namespace on first start, and the original data is left untouched.





