groups/scripts/pot-lang.sh
Christian Berendt bd3f4b83f5 Use '#!/usr/bin/env bash' as shebang in script files
Change-Id: I189d7c13425746db915415577a9e4a090aebf285
2015-08-29 20:34:00 +02:00

20 lines
520 B
Bash
Executable File

#!/usr/bin/env bash
# Create a new language skeleton from pot template files
if [ -z "$1" ]; then
echo "Usage: $0 <lang-code>"
exit 1
fi
LANG_CODE="$1"
PROFILE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )
mkdir -p $PROFILE_DIR/translations/$LANG_CODE
ls -1 $PROFILE_DIR/translations/templates/*.pot | while read f; do
FILENAME=`basename -s .pot $f`
SRC=$PROFILE_DIR/translations/templates/$FILENAME.pot
DEST=$PROFILE_DIR/translations/$LANG_CODE/$FILENAME.$LANG_CODE.po
cp $SRC $DEST
done