A modern, professional GTK3-based real-time translator with intelligent positioning and elegant design.
The application requires the following system tools:
# Ubuntu/Debian
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 apertium apertium-eng-spa xsel xdotool
# Fedora
sudo dnf install python3-gobject gtk3-devel apertium xsel xdotool
# Arch Linux
sudo pacman -S python-gobject gtk3 apertium xsel xdotool
git clone https://github.com/jesanabriah/selecttranslate
cd selecttranslate
pip install -r requirements.txt
PYTHONPATH=src python3 -m translator.main
For development, install with dev dependencies:
pip install -r requirements-dev.txt
pip install -e .
Run the application:
PYTHONPATH=src python3 -m translator.main
selecttranslate --help
options:
-h, --help show this help message and exit
--version show program's version number and exit
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Set logging level (default: INFO)
--log-file LOG_FILE Log file path (default: user config dir)
--no-console Disable console logging
--config-dir CONFIG_DIR
Override default config directory
selecttranslate/
├── src/translator/ # Main application package
│ ├── core/ # Core business logic
│ │ ├── translator.py # Translation engine
│ │ └── clipboard.py # Clipboard monitoring
│ ├── ui/ # User interface
│ │ ├── main_window.py # Main window
│ │ └── styles.py # Style management
│ ├── utils/ # Utilities
│ │ ├── positioning.py # Window positioning
│ │ └── logging_config.py # Logging setup
│ ├── config.py # Configuration
│ └── main.py # Entry point
├── tests/ # Test suite
├── docs/ # Documentation
├── assets/ # Assets (CSS, images)
├── pyproject.toml # Project configuration
├── requirements.txt # Dependencies
└── README.md # This file
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
pip install -r requirements-dev.txt
pip install -e .
# Run all tests
pytest
# Run with coverage
pytest --cov=translator
# Run specific test file
pytest tests/test_translation.py
The project uses several tools for code quality:
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/
Install pre-commit hooks for automatic code quality checks:
pre-commit install
The application uses a hierarchical configuration system:
config.py~/.config/selecttranslate/ (Linux)Key configuration sections:
The application follows a clean, modular architecture:
git checkout -b feature-nametype(scope): description
- feat: new feature
- fix: bug fix
- docs: documentation
- style: formatting
- refactor: code refactoring
- test: adding tests
- chore: maintenance
python3-gi and GTK development packagesapertium and language pairsxselxdotoolRun with debug logging for troubleshooting:
selecttranslate --log-level DEBUG
Logs are stored in:
~/.config/selecttranslate/translator.logThis project is licensed under the GNU General Public License v3 - see the LICENSE file for details.
7 commits
Python
92.5%
Makefile
4.9%
CSS
2.6%
A modern, professional GTK3-based real-time translator with intelligent positioning and elegant design.
The application requires the following system tools:
# Ubuntu/Debian
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 apertium apertium-eng-spa xsel xdotool
# Fedora
sudo dnf install python3-gobject gtk3-devel apertium xsel xdotool
# Arch Linux
sudo pacman -S python-gobject gtk3 apertium xsel xdotool
git clone https://github.com/jesanabriah/selecttranslate
cd selecttranslate
pip install -r requirements.txt
PYTHONPATH=src python3 -m translator.main
For development, install with dev dependencies:
pip install -r requirements-dev.txt
pip install -e .
Run the application:
PYTHONPATH=src python3 -m translator.main
selecttranslate --help
options:
-h, --help show this help message and exit
--version show program's version number and exit
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Set logging level (default: INFO)
--log-file LOG_FILE Log file path (default: user config dir)
--no-console Disable console logging
--config-dir CONFIG_DIR
Override default config directory
selecttranslate/
├── src/translator/ # Main application package
│ ├── core/ # Core business logic
│ │ ├── translator.py # Translation engine
│ │ └── clipboard.py # Clipboard monitoring
│ ├── ui/ # User interface
│ │ ├── main_window.py # Main window
│ │ └── styles.py # Style management
│ ├── utils/ # Utilities
│ │ ├── positioning.py # Window positioning
│ │ └── logging_config.py # Logging setup
│ ├── config.py # Configuration
│ └── main.py # Entry point
├── tests/ # Test suite
├── docs/ # Documentation
├── assets/ # Assets (CSS, images)
├── pyproject.toml # Project configuration
├── requirements.txt # Dependencies
└── README.md # This file
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
pip install -r requirements-dev.txt
pip install -e .
# Run all tests
pytest
# Run with coverage
pytest --cov=translator
# Run specific test file
pytest tests/test_translation.py
The project uses several tools for code quality:
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/
Install pre-commit hooks for automatic code quality checks:
pre-commit install
The application uses a hierarchical configuration system:
config.py~/.config/selecttranslate/ (Linux)Key configuration sections:
The application follows a clean, modular architecture:
git checkout -b feature-nametype(scope): description
- feat: new feature
- fix: bug fix
- docs: documentation
- style: formatting
- refactor: code refactoring
- test: adding tests
- chore: maintenance
python3-gi and GTK development packagesapertium and language pairsxselxdotoolRun with debug logging for troubleshooting:
selecttranslate --log-level DEBUG
Logs are stored in:
~/.config/selecttranslate/translator.logThis project is licensed under the GNU General Public License v3 - see the LICENSE file for details.
7 commits
Python
92.5%
Makefile
4.9%
CSS
2.6%