Repository navigation
The first stable release of live_translate, a drop-in Flutter widget that turns the camera into a live, offline translator. From here on, breaking changes come only in a major version.
flutter pub add live_translateThen follow the platform setup. The attached APK is the example app, built from this tag, so you can try it on an Android phone.
Highlights
- iOS model downloads now finish. On iPhone, the live view used to stay on "downloading" after a language's first model download. The held picture now gets translated as soon as the model arrives, without moving the camera.
- Measured performance. On a Samsung Galaxy M17, a read takes a median of 75 ms. On an iPhone 14 it takes 35 ms. Labels appear about 0.4 s after you hold the phone still, and the view's own work costs about 1 ms per camera frame. See Performance.
- Faster label repaint while the camera moves: about 2.6× faster on the host benchmark, with identical output.
- A complete API reference, an FAQ and a contributing guide in the README.
Breaking changes
Most apps need no changes.
| Before | Now | What to change |
|---|---|---|
TranslatedParagraph.sourceLanguage was a String? BCP-47 code |
a non-null TranslateLanguage |
Use .bcpCode where a string was used, drop null checks, and pass sourceLanguage: when building one in tests. |
TextScript was an enum |
a final class with constants | Nothing for TextScript.latin, TextScript.devanagari, values or name. A switch expression over a TextScript needs a _ case. |
LiveTranslateException and SourceStatus stay sealed. New subtypes will come only in a major version, while new scripts can come in a minor one.
Fixed
- iOS: model downloads finish.
google_mlkit_translationnever reports the end of a download on iOS. So the source status stayed on "downloading", andTranslationModels.downloadhung or threwModelNotDownloadedfor a model that did download. On iOS, a download now completes once its model is on the device, and fails if the model hasn't arrived after 5 minutes. Android is unchanged. - iOS:
wifiOnlyis documented as having no effect, because ML Kit always downloads on any network there.
New
- Changing
LiveTranslateView.resolutionrestarts the camera at the new resolution. LiveTranslateController.scriptsandsourceLanguagesreport what the view reads and expects.OverlayStyle.copyWithandtoString.- The debug HUD shows the view's own work per camera frame:
N fps · frame A.A ms avg, W.W max. - Labels repaint faster, and picking up the page's colours is about 20% faster.
- README: Performance and Size impact sections, with the tools to measure them again.
- README: Latin-only Android apps need
-dontwarn com.google.mlkit.vision.text.devanagari.**inproguard-rules.pro, or release builds fail in R8.
Full changelog: v0.2.1...v1.0.0