KoTranslate is a KOReader plugin that provides machine translation with multiple providers. It works seamlessly with the KOTranslate Android companion app for truly offline translation, and supports 7 online translation services including DeepL, Google Cloud, Microsoft Azure, Yandex, Lingva, MyMemory, and LibreTranslate.
- 9 Translation Providers:
- Default: KOReader built-in Google Translate
- Offline: KOTranslate companion app (Google ML Kit, no internet)
- DeepL: Free tier 500K chars/month (API key required)
- Google Cloud: Translation API (API key required)
- Microsoft Azure: Free tier 2M chars/month (API key required)
- Yandex: Translate API (API key required)
- Lingva: Free, no API key (proxied Google Translate)
- MyMemory: Free, 5000 chars/day, no API key
- LibreTranslate: Free, self-hosted or public instances
- 56 Languages Supported: Including English, Spanish, French, German, Chinese, Japanese, Arabic, and more
- SQLite Cache: All translations cached locally for instant reuse
- Highlight Override: Overrides KOReader's built-in Translate button (like assistant.koplugin)
- Auto-Detection: Automatically uses
localhost:8787on Android KOReader - Remote Language Management: View and manage companion app languages from KOReader
- PC-Editable Configuration: Single config file inside the plugin folder
- Zero Binary Dependencies: Pure Lua implementation
- KOReader (any recent version with plugin support)
- For Offline Mode:
- Android device with KOTranslate companion app installed, OR
- External Android phone on the same WiFi network
- For Online Modes (free, no API key):
- Internet connection (Lingva, MyMemory, LibreTranslate)
- For Online Modes (API key required):
- API key from the provider (DeepL, Google Cloud, Microsoft, Yandex)
- Internet connection
- Download or copy the
kotranslate.kopluginfolder - Place it in your KOReader plugins directory:
- Android:
/sdcard/koreader/plugins/ - Kobo:
.adds/koreader/plugins/ - Kindle:
koreader/plugins/
- Android:
IMPORTANT: The plugin requires a configuration file to work.
-
Navigate to the plugin folder:
kotranslate.koplugin/ -
Find the file:
kotranslate_configuration_sample.lua -
Rename or copy it to:
kotranslate_configuration.lua- Option A (Rename):
kotranslate_configuration_sample.lua→kotranslate_configuration.lua - Option B (Copy): Keep the sample and create a copy named
kotranslate_configuration.lua
- Option A (Rename):
-
(Optional) Edit
kotranslate_configuration.luaon your PC:- Change translation provider (default is
"default") - Add API keys for paid services (DeepL, Google, Microsoft, Yandex)
- Adjust companion app address
- Enable/disable cache
- Change source/target languages
- Change translation provider (default is
- Restart KOReader
- The plugin will appear in Menu → Plugins → KoTranslate
Note: If you skip Step 2, the plugin will create a default configuration file automatically, but it's recommended to use the sample file as a template.
- Install KOTranslate APK on your Android device
- Open KOTranslate → Tap "Start Server"
- Download language models (e.g., English, Spanish)
- In KOReader → Menu → Plugins → KoTranslate:
- Mode: Offline (Companion App) (default)
- Source Language: English
- Target Language: Spanish (or your choice)
- Highlight any text → Tap "Translate" → Done!
Note: The plugin automatically detects localhost:8787 on Android — no configuration needed.
- Install KOTranslate APK on your Android phone
- Open KOTranslate → Note the IP address (e.g.,
192.168.1.42) - Download language models
- Connect your Kobo/Kindle to the same WiFi network
- In KOReader → Menu → Plugins → KoTranslate:
- Tap "Companion App Address"
- Enter:
http://192.168.1.42:8787 - Save
- Set languages:
- Source Language: English
- Target Language: Your choice
- Highlight any text → Tap "Translate" → Done!
- In KOReader → Menu → Plugins → KoTranslate:
- Tap "Provider" → Select "Lingva" or "MyMemory"
- Set target language
- Highlight any text → Tap "Translate" → Done!
- Edit the configuration file on your PC:
- Navigate to your KOReader plugins folder
- Open
kotranslate.koplugin/kotranslate_configuration.lua - Add your API key(s) in the
api_keyssection - Save and restart KOReader
- In KOReader → Menu → Plugins → KoTranslate:
- Tap "Provider" → Select the provider with your API key
- Highlight any text → Tap "Translate" → Done!
Supported paid providers: DeepL, Google Cloud, Microsoft Azure, Yandex
- Highlight any text in your book
- Tap "Translate" in the highlight menu
- View the translation in a popup dialog
- Open Menu → Tools → KoTranslate
- Tap "Translate Input Text"
- Enter text manually
- Tap "Translate"
- Open Menu → Tools → KoTranslate
- Tap "Provider: ..." at the top
- Select from 9 available providers
- Providers requiring API keys are disabled until keys are configured
- Open Menu → Tools → KoTranslate
- Tap "Source Language: ..." to change source
- Tap "Target Language: ..." to change target
- Select from the list of 56 languages
- Open Menu → Tools → KoTranslate
- Tap "Test Connection"
- For offline mode: Shows companion app status and IP
- For online mode: Performs a test translation
- Open Menu → Tools → KoTranslate
- Tap "Manage Companion Languages"
- View downloaded and available languages
- Note: To download/delete models, use the companion app directly
- Open Menu → Tools → KoTranslate
- View "Cache: X entries (Y KB)" at the bottom
- Tap "Clear Cache" to delete all cached translations
All settings are stored inside the plugin folder:
kotranslate.koplugin/kotranslate_configuration.lua
How to edit:
- Connect your e-reader to your PC
- Navigate to the plugin folder
- Open
kotranslate_configuration.luain any text editor (Notepad, VS Code, etc.) - Modify the settings (see table below)
- Save the file
- Restart KOReader to apply changes
Template file: A sample configuration file is provided as kotranslate_configuration_sample.lua for reference.
This file is a valid Lua file that returns a table with key-value pairs.
| Setting | Description | Default |
|---|---|---|
mode |
Translation provider ID | default |
source_lang |
Source language code or auto |
auto |
target_lang |
Target language code | tr |
enable_cache |
Enable translation cache | false |
companion_address |
Companion app URL | http://192.168.1.100:8787 |
api_keys.deepl_api_key |
DeepL API key | (empty) |
api_keys.google_api_key |
Google Cloud API key | (empty) |
api_keys.microsoft_api_key |
Microsoft Azure API key | (empty) |
api_keys.yandex_api_key |
Yandex API key | (empty) |
microsoft_region |
Azure region | global |
lingva_instance |
Lingva instance URL | lingva.ml |
libre_instance |
LibreTranslate instance URL | libretranslate.com |
libre_api_key |
LibreTranslate API key | (empty) |
mymemory_email |
MyMemory email for higher limits | (empty) |
Translations are cached in:
<KOReader data directory>/kotranslate_cache.sqlite3
The cache stores:
- Source and target language
- Original and translated text
- Provider (offline/online)
- Usage statistics
- Book path (for per-book filtering)
kotranslate.koplugin/
├── _meta.lua # Plugin metadata
├── main.lua # Entry point, menu, Translator override
├── kotranslate_configuration.lua # User-editable configuration file
├── kotranslate_providers.lua # All translation provider implementations
├── kotranslate_cache.lua # SQLite cache layer
├── kotranslate_client.lua # HTTP client for companion app
├── kotranslate_ui.lua # UI dialogs and popups
├── kotranslate_languages.lua # Language code mappings
├── roadmap.md # Full architecture documentation
└── README.md # This file
| Module | Purpose |
|---|---|
main.lua |
Plugin init, menu, Translator.showTranslation override |
kotranslate_configuration.lua |
User-editable settings (API keys, provider, languages) |
kotranslate_providers.lua |
7 online translation providers (DeepL, Google, Microsoft, Yandex, Lingva, MyMemory, LibreTranslate) |
kotranslate_client.lua |
REST API client for companion app (7 endpoints) |
kotranslate_cache.lua |
SQLite-based translation cache with usage tracking |
kotranslate_ui.lua |
Translation result viewer, copy/save buttons |
kotranslate_languages.lua |
56 language codes and names |
User highlights text
↓
Plugin checks cache
↓
Cache hit? → Show cached result
↓
Cache miss → Translate via mode:
↓
Offline mode:
1. Try localhost:8787 (Android)
2. Try configured companion address
↓
Online mode:
1. Call selected provider API
↓
Store in cache → Show result
Afrikaans (af), Albanian (sq), Arabic (ar), Belarusian (be), Bengali (bn), Bulgarian (bg), Catalan (ca), Chinese (zh), Croatian (hr), Czech (cs), Danish (da), Dutch (nl), English (en), Esperanto (eo), Estonian (et), Finnish (fi), French (fr), Galician (gl), Georgian (ka), German (de), Greek (el), Gujarati (gu), Hindi (hi), Hungarian (hu), Icelandic (is), Indonesian (id), Irish (ga), Italian (it), Japanese (ja), Kannada (kn), Korean (ko), Latvian (lv), Lithuanian (lt), Macedonian (mk), Malay (ms), Maltese (mt), Marathi (mr), Norwegian (no), Persian (fa), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Slovak (sk), Slovenian (sl), Spanish (es), Swahili (sw), Swedish (sv), Tagalog (tl), Tamil (ta), Telugu (te), Thai (th), Turkish (tr), Ukrainian (uk), Urdu (ur), Vietnamese (vi), Welsh (cy)
Cause: KOReader cannot connect to the companion app.
Solutions:
- Check companion app: Ensure KOTranslate is running and shows "Server Running"
- Check address: Verify the IP address in KOReader matches the one shown in KOTranslate
- Same WiFi: Both devices must be on the same WiFi network
- Firewall: Some routers block device-to-device communication
- Test connection: Use "Test Connection" in the plugin menu
Cause: Required language models are not downloaded in the companion app.
Solutions:
- Open KOTranslate on your Android device
- Download both source and target language models
- Download English if translating between non-English pairs (used as pivot)
Cause: Network latency or first-time model loading.
Solutions:
- Use cache: Repeated translations are instant (cached)
- Offline mode: Faster than online mode (no internet roundtrip)
- Pre-download models: Ensure models are downloaded before translating
Cause: Database corruption or permission issues.
Solutions:
- Clear cache: Menu → KoTranslate → Clear Cache
- Check permissions: Ensure KOReader can write to data directory
- Restart KOReader
Cause: Companion app returned malformed data or crashed.
Solutions:
- Restart companion app: Stop and start the server
- Check companion app logs: Use
adb logcatto view errors - Update companion app: Ensure you have the latest version
Cause: Invalid API key, quota exceeded, or provider issue.
Solutions:
- Check API key: Open
kotranslate_configuration.luaon your PC and verify the key - Try a free provider: Switch to Lingva, MyMemory, or LibreTranslate (no key needed)
- Check quota: Some providers have daily/monthly limits
- Test connection: Use "Test Connection" in the plugin menu
- First translation: ~1-3 seconds (network + ML Kit)
- Cached translation: Instant (<50ms)
- Cache size: ~1-2 KB per translation
- Offline mode: Zero internet usage (LAN only)
- Online mode: ~500 bytes per request (varies by text length)
- Plugin size: ~30 KB
- Cache database: Grows with usage (~1-2 KB per unique translation)
- Recommended: Clear cache periodically if it exceeds 10 MB
- No internet required: All translation happens on the companion device
- No data sent to Google servers: ML Kit runs entirely on-device
- LAN only: Communication stays within your local network
- Data sent to Google: Text is sent to Google Cloud Translation API
- Google Privacy Policy applies: See https://policies.google.com/privacy
- API key security: Store securely, do not share
- Local storage only: Cache database never leaves your device
- No telemetry: Plugin does not send any usage data
This plugin requires the KOTranslate Android companion app for offline mode.
Download: Build from source using Docker (see companion app README)
Repository: https://github.com/omer-faruq-android-apps/kotranslate
This plugin uses:
- Google ML Kit (via companion app) — Subject to ML Kit Terms of Service
- Google Cloud Translation API (online mode) — Subject to Google Cloud Terms
Attribution: Powered by Google
For issues, feature requests, or contributions, please refer to the main KOReader plugin repository.
- Companion App README: https://github.com/omer-faruq-android-apps/kotranslate/blob/main/README.md
- KOReader Documentation: https://github.com/koreader/koreader