How fishjar/kiss-translator works
KISS Translator is a browser translation extension and userscript. A user selects text or invokes page translation; the interface sends work through translation APIs to configured built-in or plugin services and presents bilingual results. Separate product stages cover selection/dictionary lookup, webpages and subtitles, and document/image processing. Provider capability selection and local-AI model/runtime management are important internal layers. README documents the broader feature set; several implementation paths are supported only by the tree and are shown without speculative call edges.
Main entry points: index.js Translation APIs · translator.js Webpage translation · pipelineCore.js File pipeline · modelManager.ts Model manager
Components 21
Translation interaction
- Selection controller
src/hooks/useSelectionController.js - Selection UI
src/views/Selection/index.js - Dictionary handler
src/views/Selection/DictHandler.js - Settings storage
src/libs/storage.js
Services and providers
- Translation APIs
src/apis/index.js - Translation engines
src/apis/trans.js - Service selection
src/config/serviceSelection.js - Plugin runtime
src/builtin-plugins/runtime.js - Provider plugins
src/providers/registry.js - Translation services
Page and media translation
- Webpage translation
src/libs/translator.js - Page rules
src/libs/rules.js - Bilingual subtitles
src/subtitle/BilingualSubtitleManager.js
File translation
- File translation UI
src/views/FileTranslate/index.js - File pipeline
src/fileTranslation/pipelineCore.js - Result cache
src/fileTranslation/resultCache.js - Image translation
src/libs/imageTranslate/imageTranslateManager.js
Local AI
- Model manager
src/localAi/core/modelManager.ts - Inference runtime
src/localAi/runtime/runtimeManager.ts - Model catalog
src/localAi/core/catalog.ts
Other components
- User
Connections 23
- User → Selection controller: selects text
README.md - Selection controller → Selection UI: opens panel
- Selection UI → Dictionary handler: looks up words
src/views/Selection/DictHandler.js - Dictionary handler → Translation APIs: requests lookup
src/views/Selection/DictHandler.js - Translation APIs → Translation engines: delegates translation
src/apis/index.js - Translation APIs → Translation services: sends requests
README.md - Service selection → Provider plugins: validates capabilities
src/config/serviceSelection.js - Plugin runtime → Translation services: dispatches plugin calls
- User → Webpage translation: starts page translation
README.md - Webpage translation → Translation APIs: translates page text
- Webpage translation → Page rules: applies rules
- User → Bilingual subtitles: opens subtitles
README.md - Bilingual subtitles → Translation APIs: requests translation
src/subtitle/BilingualSubtitleManager.js - User → File translation UI: chooses file
README.md - File translation UI → File pipeline: starts processing
- File pipeline → Result cache: reads and writes results
src/fileTranslation/pipelineCore.js - File pipeline → Translation APIs: invokes providers
src/fileTranslation/pipelineCore.js - User → Image translation: translates image
README.md - Image translation → Translation APIs: requests image services
- Model manager → Model catalog: loads catalog
src/localAi/core/modelManager.ts - Model manager → Inference runtime: uses runtime host
src/localAi/core/modelManager.ts - Inference runtime → Model manager: manages model state
src/localAi/runtime/runtimeManager.ts - Translation APIs → Settings storage: reads settings
src/apis/index.js