update-translations.sh 488 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5
# don't fail on unknown byte sequences
export LC_CTYPE=C

6
tx pull -af --minimum-perc=1
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

if [ "$(uname)" == "Darwin" ]; then
    option="-I"
else
    option="-i"
fi

for file in `find . -name '*.strings'`; do
    # Convert file if encoding is utf-16le
    if [ `file $option $file | awk '{print $3;}'` = "charset=utf-16le" ]; then
        echo "Converting $file..."
        iconv -f UTF-16LE -t UTF-8 $file > $file.8
        cp -f $file.8 $file
        rm $file.8
    fi
done