1.4 KiB
TRANSLATION
You can help Appflowy in supporting various languages by contributing. Follow the steps below sequentially to contribute translations.
NOTE: Translation files SHOULD be json
files named in the format <lang_code>-<country_code>.json
or just <lang_code>.json
. eg:en.json
, en-UK.json
Steps to add new language support
-
Add language key-value json file to
frontend/app_flowy/assets/translations/
. Referen.json
for format and keys. -
Run
flutter pub run easy_localization:generate -S assets/translations/
. -
Run
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
. -
Add locale of the language (eg:
Locale('en', 'IN')
,Locale('en')
) insupportedLocales
list underEasyLocalization
wrapper for flutter to support it. This is located infrontend/app_flowy/lib/startup/tasks/application_widget.dart
underAppWidgetTask
class as shown below:runApp( EasyLocalization( supportedLocales: const [ Locale('en') ], // <---- Add locale to this list path: 'assets/translations', fallbackLocale: const Locale('en'), child: app), );
Steps to modify translations
- Modify the specific translation file.
- Run
flutter pub run easy_localization:generate -S assets/translations/
. - Run
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
.