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.

32 lines
739 B

  1. #!/bin/bash
  2. # Author: Sotiris Papadopoulos
  3. # Last-Edited: 25/02/2015
  4. # Script to auto-create a locale file.
  5. # Usage: ./build_locale.sh <locale> <locale_file>
  6. # Example: ./build_locale.sh gr_GR gr.po
  7. # To create a new locale file copy youtube_dl_gui.po
  8. # to a new locale file (e.g. gr.po) edit it with your
  9. # favorite editor and then run this script.
  10. FILENAME="youtube_dl_gui"
  11. if [ "$#" -ne 2 ]; then
  12. echo "Usage: $0 <locale> <locale_file>"
  13. echo "Example: $0 gr_GR gr.po"
  14. exit 1
  15. fi
  16. mkdir -p "../$FILENAME/locale/$1/LC_MESSAGES/"
  17. msgfmt --output-file "$FILENAME.mo" "$2"
  18. mv "$2" "../$FILENAME/locale/$1/LC_MESSAGES/$FILENAME.po"
  19. mv "$FILENAME.mo" "../$FILENAME/locale/$1/LC_MESSAGES/"
  20. tree "../$FILENAME/locale/$1"
  21. echo "Done"