Flutter
Flutter SDK
Requirements
Locale Sync’s SDK integrates with Flutter through flutter_localizations package, so, naturally, you’ll need to get this added to your pubspec.yaml:
Once added, you need to add your supported locales on your app widget along with the localization delegates:
Installing
Add locale_sync package as a dependency:
Once you have already added your config file and your translation fallback file you can generate your .dart files by running:
If you want to upload it to servers already you can just run after:
This will send your translations to the repository specified in your config file, upserting languages and strings from your file.
On your app widget you need to add LocaleSync.delegate to that list:
Over the air
If you want to use our over-the-air strings feature you just need to call setup method from LocaleSync on your main.dart, or whatever entry point you’re using:
Getting translations
When you get strings which takes arguments you add it as a function arg, and the same is applied to plural strings: