mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
4a49669cc5
Simplified the wording of the 'add new language' case.
1.6 KiB
1.6 KiB
TRANSLATION
You can help Appflowy in supporting various languages by contributing. Follow the steps below sequentially to contribute translations.
Steps to modify an existing translation
Translation files are located in : frontend/app_flowy/assets/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
- Verify that the translation has changed appropriately by compiling and running the app.
Steps to add new language
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
- 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
- Open the
frontend/app_flowy/lib/startup/tasks/application_widget.dart
file. - In the
AppWidgetTask
class, add the locale of the language you just created (eg:Locale('en', 'IN')
,Locale('en')
) to thesupportedLocales
List :
runApp(
EasyLocalization(
supportedLocales: const [Locale('en'), Locale('zh_CN')], // <---- Add locale to this list
path: 'assets/translations',
fallbackLocale: const Locale('en'),
child: app),
);