How lamvu211/direct-trans works
DirectTrans is a Windows tray application that translates selected text through configured AI or Google Translate providers, then displays the result or replaces the selection. Its principal workflow is global-hotkey handling, selection capture, translation, and popup/replacement. Settings cover providers, API keys, themes, language, hotkeys, startup, updates, and feedback. The graph reflects README-described capabilities and relationships listed in the source index; unsampled runtime details are not assumed.
Main entry points: settings_window.py Settings window · main.py App coordinator · popup_window.py Translation popup · translator.py Translation providers
Components 18
Translation workflow
- App coordinator
src/main.py - Global hotkeys
src/hotkey_manager.py - Selection and RTF
src/clipboard_util.py - Translation providers
src/translator.py
Settings and preferences
- App configuration
src/config.py - Provider settings
src/ui/qt/api_section.py - Hotkey management
src/ui/qt/hotkey_manage_dialog.py - Hotkey editor dialog
src/ui/qt/hotkey_dialog.py
User interface
- Translation popup
src/ui/qt/popup_window.py - Settings window
src/ui/qt/settings_window.py - System tray
src/tray.py - Theme registry
src/ui/qt/theme.py - UI translations
src/ui/i18n.py - Font mapping
src/font_mapper.py
Integrations and support
- Update checker
src/updater.py - Feedback helper
src/feedback_util.py - Translation services
Other components
- Desktop user
Connections 20
- Desktop user → Global hotkeys: presses hotkey
README.md - Global hotkeys → App coordinator: triggers callback
src/hotkey_manager.py - App coordinator → Selection and RTF: captures selection
README.md - App coordinator → Translation providers: requests translation
README.md - Translation providers → Translation services: sends request
README.md - App coordinator → Translation popup: shows result
README.md - Translation popup → Selection and RTF: replaces selection
src/ui/qt/popup_window.py - Desktop user → Settings window: opens settings
README.md - System tray → Settings window: opens settings
README.md - Settings window → Provider settings: builds section
src/ui/qt/settings_window.py - Settings window → Hotkey management: manages hotkeys
src/ui/qt/settings_window.py - Hotkey management → Hotkey editor dialog: opens editor
src/ui/qt/hotkey_manage_dialog.py - Settings window → App configuration: saves preferences
src/ui/qt/settings_window.py - Provider settings → Translation providers: tests provider
src/ui/qt/api_section.py - Settings window → Theme registry: applies theme
src/ui/qt/settings_window.py - Settings window → UI translations: loads translations
src/ui/qt/settings_window.py - Translation popup → Theme registry: applies theme
src/ui/qt/popup_window.py - Translation popup → Font mapping: maps fonts
src/ui/qt/popup_window.py - Settings window → Update checker: checks updates
src/ui/qt/settings_window.py - Settings window → Feedback helper: opens feedback
src/ui/qt/settings_window.py