You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
682 B

  1. #!/bin/bash
  2. # Author: Sotiris Papadopoulos <ytubedlg@gmail.com>
  3. # Last-Revision: 2017-01-30
  4. # Script to add support for a new language
  5. #
  6. # Usage: ./new-locale.sh <locale>
  7. # Example: ./new-locale.sh gr_GR
  8. PACKAGE="youtube_dl_gui"
  9. PO_FILE="$PACKAGE.po"
  10. if [ "$#" -ne 1 ]; then
  11. echo "Usage: $0 <locale>"
  12. echo "Example: $0 gr_GR"
  13. exit 1
  14. fi
  15. cd ..
  16. TARGET="$PACKAGE/locale/$1"
  17. if [ -d "$TARGET" ]; then
  18. echo "[-]Locale '$1' already exists, exiting..."
  19. exit 1
  20. fi
  21. echo "[*]Creating directory: '$TARGET'"
  22. mkdir -p "$TARGET/LC_MESSAGES"
  23. echo "[*]Copying files..."
  24. cp -v "$PACKAGE/locale/en_US/LC_MESSAGES/$PO_FILE" "$TARGET/LC_MESSAGES/$PO_FILE"
  25. echo "[*]Done"