ARB & gen-l10n
TransLocale for Flutter.
Find ARB files, translate with your product context, and compile the downloaded wording with Flutter's localization generator.
1. Install
Run this from your application directory.
flutter pub add --dev translocale_flutter:^0.1.0Upgrading from 0.0.1? Read the migration notes. This release uses build-time ARB tooling.
2. Connect your project
Create a cloud project and replace PROJECT_UUID with its ID. The source and target languages must match your local configuration. Adjust the example locales to your project.
dart run translocale_flutter:translocale discover
dart run translocale_flutter:translocale init --api https://translocale.io --project PROJECT_UUID --locales en,fr,arApprove translation access in the browser:
dart run translocale_flutter:translocale login --scope translateSign-in is shared with your other TransLocale tools for this project. Keep credentials in developer tooling or CI. Your deployed app reads its own translation files.
3. Wire up your app
Configure Flutter localization in pubspec.yaml and l10n.yaml first. Setup reads those files and creates translocale.flutter.json without replacing catalogs. The check command runs flutter gen-l10n. Use the generated localizations in your widgets; the Dart tooling stays a development dependency.
4. Translate, review, and download
Inspect the plan before running translate. The example caps the job at 1,000 source characters across its target languages. Waiting stops after two minutes; a timeout leaves the job running.
dart run translocale_flutter:translocale plan
dart run translocale_flutter:translocale translate --max-characters 1000 --wait
dart run translocale_flutter:translocale pull --job JOB_UUID --locale fr --revision 1
dart run translocale_flutter:translocale checkReplace JOB_UUID with the completed job ID. Before pulling revision 1, save that revision in the dashboard and review its wording. Choose the exact saved revision you want to ship, then repeat pull for each target locale. Revision 0 is the original generated output.
Normal application builds use saved catalogs and make no paid translation requests.
Already have translations?
The package discovers existing ARB catalogs from l10n.yaml. A pull refuses to replace an existing target: add --out candidates/fr.arb, review the candidate, and merge it manually. Automatic three-way sync is not available for Dart yet. Source metadata and the job's source snapshot must match before a download is accepted.
Current limits
- Strict-mode ARB imports with use-escaping: true are not supported. The separate main CLI can export strict-escaped files from service ARB.
- File writes require the POSIX link utility. macOS is verified; Windows support and native device verification remain pending.
The service accepts up to 100 KB and 200 messages per source document, with up to 10 target languages. Expanded target messages must also fit the adapter's limits. Read the file compatibility guide.