2023-07-03 04:07:11 -10:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "Generating language files"
|
|
|
|
|
|
|
|
# Store the current working directory
|
|
|
|
original_dir=$(pwd)
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
# Navigate to the project root
|
|
|
|
cd ../../../appflowy_flutter
|
|
|
|
|
2023-07-11 19:27:40 +07:00
|
|
|
# copy the resources/translations folder to
|
2023-08-01 14:19:45 +08:00
|
|
|
# the appflowy_flutter/assets/translation directory
|
|
|
|
rm -rf assets/translations/
|
|
|
|
mkdir -p assets/translations/
|
|
|
|
cp -f ../resources/translations/*.json assets/translations/
|
2023-07-11 19:27:40 +07:00
|
|
|
|
2024-03-05 17:20:27 +08:00
|
|
|
# the ci alwayas return a 'null check operator used on a null value' error.
|
|
|
|
# so we force to exec the below command to avoid the error.
|
|
|
|
# https://github.com/dart-lang/pub/issues/3314
|
2024-02-01 19:58:58 +07:00
|
|
|
flutter pub get
|
|
|
|
flutter packages pub get
|
2023-07-03 04:07:11 -10:00
|
|
|
|
|
|
|
echo "Specifying source directory for AppFlowy Localizations."
|
|
|
|
dart run easy_localization:generate -S assets/translations/
|
|
|
|
|
|
|
|
echo "Generating language files for AppFlowy."
|
|
|
|
dart run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json
|
|
|
|
|
|
|
|
echo "Done generating language files."
|
|
|
|
|
|
|
|
# Return to the original directory
|
|
|
|
cd "$original_dir"
|