generate_language_files.sh 797 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. echo "Generating language files"
  3. # Store the current working directory
  4. original_dir=$(pwd)
  5. cd "$(dirname "$0")"
  6. # Navigate to the project root
  7. cd ../../../appflowy_flutter
  8. # copy the resources/translations folder to
  9. # the appflowy_flutter/assets/translation directory
  10. rm -rf assets/translations/
  11. mkdir -p assets/translations/
  12. cp -f ../resources/translations/*.json assets/translations/
  13. flutter packages pub get
  14. echo "Specifying source directory for AppFlowy Localizations."
  15. dart run easy_localization:generate -S assets/translations/
  16. echo "Generating language files for AppFlowy."
  17. dart run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json
  18. echo "Done generating language files."
  19. # Return to the original directory
  20. cd "$original_dir"