How muanyan-mjq/zotero-interlinear works
Interlinear is a Zotero desktop-reader plugin for translating structured PDF paragraphs inline. Its main workflow runs from reader interaction through translation orchestration and a selected service, then renders and caches results. The README also documents chat assistance, bilingual export, glossary enforcement, appearance controls, and alternate reader layouts. Sampled source supports key reader, provider, settings, and cache links; other feature links rely on README statements, so unsampled implementation details are not inferred.
Main entry points: bilingualReader.ts Reader orchestration · settings.ts Settings and preferences · preferenceScript.ts Settings interface · index.ts Provider registry
Components 24
Reader experience
- Reader orchestration
src/bilingualReader.ts - Reader controls
src/readerUI.ts - Paragraph interactions
src/readerInteractions.ts - Display modes
src/displayMode.ts - Linked highlighting
src/readerHighlight.ts - Reading layouts
src/readingLayout.ts - Split-pane scrolling
src/readerScrollSync.ts
Translation runtime
- Batch preparation
src/translationPipeline.ts - Translation cache
src/translationCache.ts - Translation formatting
src/translationFormat.ts
Translation services
- Provider registry
src/providers/index.ts - Free-service routing
src/providers/free.ts - Google Translate
src/providers/google.ts - LLM chat requests
src/providers/chat.ts - Secure HTTP requests
src/providers/secureRequest.ts
Configuration and appearance
- Settings and preferences
src/settings.ts - Settings interface
src/modules/preferenceScript.ts - Appearance controls
src/appearance.ts - Font catalog
src/fontCatalog.ts
Reader support
- Glossary
src/glossary.ts - Reading assistant
src/chatPane.ts - Chat context
src/chatContext.ts - Bilingual PDF export
src/exportLayout.ts
Other components
- Zotero reader
Connections 27
- Zotero reader → Reader orchestration: opens reader
README.md - Reader orchestration → Batch preparation: prepares batches
src/bilingualReader.ts - Reader orchestration → Provider registry: requests translations
src/bilingualReader.ts - Reader orchestration → Translation cache: loads cached results
src/bilingualReader.ts - Reader orchestration → Translation formatting: renders translations
src/bilingualReader.ts - Provider registry → Free-service routing: dispatches free service
src/providers/index.ts - Provider registry → LLM chat requests: dispatches chat
src/providers/index.ts - Free-service routing → Google Translate: uses Google backend
src/providers/free.ts - LLM chat requests → Secure HTTP requests: sends requests
src/providers/chat.ts - Reader orchestration → Settings and preferences: reads translation settings
src/bilingualReader.ts - Settings and preferences → Glossary: configures glossary terms
src/settings.ts - Settings and preferences → Appearance controls: stores appearance options
src/settings.ts - Settings interface → Settings and preferences: saves preferences
src/modules/preferenceScript.ts - Settings interface → Appearance controls: edits appearance
src/modules/preferenceScript.ts - Settings interface → Font catalog: uses font detection
src/modules/preferenceScript.ts - Zotero reader → Reader controls: uses reader controls
README.md - Reader controls → Reader orchestration: controls translation runs
src/bilingualReader.ts - Paragraph interactions → Reader orchestration: triggers paragraph translation
src/bilingualReader.ts - Reader orchestration → Display modes: cycles display modes
src/bilingualReader.ts - Reader orchestration → Split-pane scrolling: starts pane synchronization
src/bilingualReader.ts - Reader orchestration → Linked highlighting: updates linked highlights
src/bilingualReader.ts - Reader orchestration → Reading layouts: renders reader layouts
src/bilingualReader.ts - Zotero reader → Reading assistant: asks reading questions
README.md - Reading assistant → Chat context: uses document context
- Reading assistant → LLM chat requests: sends assistant turns
- Zotero reader → Bilingual PDF export: exports bilingual PDF
README.md - Reader orchestration → Glossary: applies glossary
src/bilingualReader.ts