How to translate Flutter app

To translate the Flutter app, please navigate to folder /assets/translations, press the right button on the languages folder, create a new file, and name it with your language code (.json format). For example, if your language is Bengali, you must name your file bn.json. You must name it with an appropriate and valid language code or the app will not work. To get the language and country codes, you can visit URL:

https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html

Next, copy all data of the file en.json and paste it into the file you created. You can use the following tool for translation: https://translate.i18next.com/

Translate all English text placed here after a colon (:) into your local language. Has text in key-value format. You only have to translate the value, not the key otherwise it won’t work. For example: “home”: “Home” -> “home”: “বাড়ি”

Then run the command:
flutter pub run easy_localization:generate -S assets/translations -f keys -O lib/l10n -o locale_keys.g.dart

In the code you need the language theme item to be translated into the following files: