How toosynxed/comiclang works
ComicLang is a macOS on-device manga/comic translator. The main flow is selecting a screen region, capturing it, recognizing text and layout, preparing regions, translating, and displaying horizontal English chips. AppModel owns both one-shot and repeated live refreshes, including pause/resume and settings-driven layout options. The sampled sources support the main service calls and overlay rendering; several AppModel sections and other implementation details were omitted, so no further internal wiring is inferred.
Main entry points: AppModel.swift Workflow coordinator · MenuBarView.swift Menu and settings · ComicLangApp.swift App entry · RegionSelector.swift Region selection
Components 16
App interaction
- App entry
ComicLang/ComicLangApp.swift - Menu and settings
ComicLang/UI/MenuBarView.swift - Workflow coordinator
ComicLang/AppModel.swift - Region selection
ComicLang/UI/RegionSelector.swift
Translation pipeline
- Screen capture
ComicLang/Services/ScreenCaptureService.swift - Text recognition
ComicLang/Services/OCRService.swift - Region layout
ComicLang/Services/RegionLayout.swift - Bubble detection
ComicLang/Services/SpeechBubbleDetector.swift - On-device translation
ComicLang/Services/TranslationService.swift - Translation data models
ComicLang/Models.swift
Overlay display
- Overlay controller
ComicLang/UI/OverlayWindowController.swift - Translation chips
ComicLang/UI/TranslationChipsView.swift
Apple frameworks
- ScreenCaptureKit
- Apple Vision
- Apple Translation
Other components
- User
Connections 16
- User → Menu and settings: chooses action
- App entry → Menu and settings: presents
- App entry → Workflow coordinator: creates
- Menu and settings → Workflow coordinator: starts or configures
- Workflow coordinator → Region selection: requests region
- Region selection → Workflow coordinator: returns selection
- Workflow coordinator → Screen capture: captures region
- Screen capture → ScreenCaptureKit: requests screenshot
- Workflow coordinator → Text recognition: recognizes image
- Text recognition → Apple Vision: performs recognition
- Workflow coordinator → Region layout: prepares regions
- Region layout → Bubble detection: expands to bubble
- Workflow coordinator → On-device translation: translates text
- On-device translation → Apple Translation: translates on device
- Workflow coordinator → Overlay controller: updates overlay
- Overlay controller → Translation chips: renders lines