An Android translator app that performs text and image translation completely offline using on-device models.
Supports automatic language detection and transliteration for non-latin scripts. There's also a built-in word dictionary.
Complete offline translation - download language packs once, translate forever without internet.
Language packs contain the full translation models, translation happens on your device, no requests are sent to external servers.
- Translation models are firefox-translations-models
- The translation models run on bergamot-translator
- OCR models are Tesseract
- Automatic language detection is done via cld2
- Dictionary is based on data from Wiktionary, exported by Kaikki
- For Japanese specifically, there's a second "word dictionary" (Mecab) for transliterating Kanji
This app also offers an API to other apps (check ITranslationService.aidl), so that they can request translations to be performed for
them.
If you want to use this app on a device with no internet access, you can put the language files on Documents/dev.davidv.translator. Check
OFFLINE_SETUP.md for details.
This app works fine on aarch64, and it "works" on x86-64 -- in quotes because it currently requires AVX2, which is not available on the standard emulator, nor in the ABI.
You can be cheeky and run a VM with a good CPU configuration like this
cd $ANDROID_SDK/emulator
export LD_LIBRARY_PATH=$PWD/lib64:$PWD/lib64/qt/lib
$ANDROID_SDK/emulator/qemu/linux-x86_64/qemu-system-x86_64 -netdelay none -netspeed full -avd Medium_Phone_API_35 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300 -qemu -cpu max
# The important bit is
# `-qemu -cpu max`If you don't do this, you will just get a SIGILL when trying to load the library.
bash build.shwill trigger a build in a docker container, matching the CI environment.
- Bump
app/build.gradle.ktsversionName and versionCode - Create a changelog in
fastlane/metadata/android/en-US/changelogsas${versionCode}.txt - Create a tag that is
v${versionName}(eg:v0.1.0) - Create a Github release named
v${versionName}(eg:v0.1.0)- Upload the signed APK to the release
bash sign-apk.sh keystore.jks keystorepass pass aliaswill sign the file built by build.sh (app/build/outputs/apk/aarch64/release/app-aarch64-release-unsigned.apk) and place the signed copy, with version number, in signed/
SHA-256 hash of signing certificate: 2B:38:06:E7:45:D8:09:01:8A:51:BE:58:D0:63:5F:FC:74:CC:97:33:43:94:07:AB:1E:D0:42:4A:4D:B3:E1:FB
This project was funded through the NGI Mobifree Fund, a fund established by NLnet.






