generate_language_files.sh 733 B

12345678910111213141516171819202122232425262728
  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. cp -r ../resources/translations assets/translations
  11. flutter packages pub get
  12. echo "Specifying source directory for AppFlowy Localizations."
  13. dart run easy_localization:generate -S assets/translations/
  14. echo "Generating language files for AppFlowy."
  15. dart run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json
  16. echo "Done generating language files."
  17. # Return to the original directory
  18. cd "$original_dir"