☎
Translate AppFlowy
You can help Appflowy in supporting various languages by contributing. Follow the steps below sequentially to contribute translations.
Translation files are located in :
frontend/app_flowy/assets/translations/
- 1.Modify the specific translation file.
- 2.Run
flutter pub run easy_localization:generate -S assets/translations/
- 3.Run
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
- 4.Verify that the translation has changed appropriately by compiling and running the app.
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
- 1.Add language key-value json file to
frontend/app_flowy/assets/translations/
. Referen.json
for format and keys. - 2.Run
flutter pub run easy_localization:generate -S assets/translations/
- 3.Run
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
- 4.Open the
frontend/app_flowy/lib/startup/tasks/app_widget.dart
file. - 5.In the
InitAppWidgetTask
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 listpath: 'assets/translations',fallbackLocale: const Locale('en'),child: app),); - 6.Add the name of your language, in your native tongue, to the list of language names in
AppFlowy/frontend/app_flowy/packages/flowy_infra/lib/language.dart
String languageFromLocale(Locale locale) {switch (locale.languageCode) {// Most often usedcase "en":return "English";case "zh":return "简体中文";// Then in alphabetical ordercase "de":return "Deutsch";case "es":return "Español";case "fr":return "Français";// <- add your language here.// If not found then the language code will be displayeddefault:return locale.languageCode;}}
Once your language is added to the language picker, you can simply choose it.
Last modified 10mo ago