DavidVentura/offline-translator
Use Firefox Translation Models for on-device translation on Android
Translator – Offline AI‑powered translation for Android
What it is
- A native Android app that lets you translate text, documents (PDF/ODT) and images without ever needing an internet connection.
- All heavy‑lifting (language detection, OCR, translation, text‑to‑speech) runs on‑device using pre‑downloaded model packs.
Key capabilities
| Feature | How you use it |
|---|---|
| Text translation | Share or type text, or long‑press any text in another app and choose Translate from the share menu. |
| Mini‑popup translation | Long‑press text → Translate in the copy/share bar for a quick overlay. |
| URL translation | Share a link from any app. |
| Image translation | Share an image; the app runs OCR then translates the extracted text. |
| Document translation | Open the Documents tab, pick a PDF/ODT file, and the app translates page‑by‑page. |
| Dictionary lookup | Long‑press a word inside the app to see definitions and transliterations. |
| Text‑to‑speech | Tap the play button; long‑press it to change voice or speed. |
| Developer API | An AIDL interface (ITranslationService.aidl) lets other Android apps request translations programmatically. |
Supported languages
- 55 languages ranging from Afrikaans to Vietnamese, including both simplified and traditional Chinese, Arabic, Hindi, Swahili, etc.
How it works under the hood
- Translation models – Re‑uses Mozilla’s open‑source translation models.
- OCR – Powered by PaddleOCR for extracting text from images.
- Language detection – Uses the CLD2 library.
- Dictionary – Wiktionary data exported via Kaikki; Japanese also gets a Mecab‑based dictionary for Kanji transliteration.
- TTS – Supports multiple open‑source voice engines (Piper, Coqui‑TTS, Kokoro, Facebook MMS‑TTS, Sherpa ONNX, Mimic3).
- Document handling – PDF manipulation via MuPDF and lopdf.
- Inference runtimes – Translation runs on the slimt engine; OCR, TTS and alignment use Alibaba’s MNN framework.
Offline setup
- Language packs are downloaded once (via the app or manually) and stored in
Documents/dev.davidv.translatorfor devices without internet. SeeOFFLINE_SETUP.mdfor details.
Building & releasing
# Build inside the provided Docker environment
bash build.sh
# Sign the APK (replace placeholders with your keystore info)
bash sign-apk.sh keystore.jks keystorepass pass alias
- Versioning follows Android’s
versionCodescheme with ABI offsets (armv7=1, arm64=2, x86=3, x86_64=4). - Release steps include updating
app/build.gradle.kts, creating changelog files, building, signing, tagging (vX.Y.Z) and publishing on GitHub and F‑Droid.
Funding & licensing
- Funded by the NLnet NGI Mobifree grant.
- Open‑source; the code and model packs are freely redistributable under the licenses of the underlying components.
Get it
- Install from F‑Droid: https://f-droid.org/packages/dev.davidv.translator
- Source code and issue tracker on GitHub and mirrored on Codeberg.
This summary is based solely on the repository’s README.
Related
- Project
- Project
- Project
- Project
- Project