translations: convert .string files from Transifex to UTF-8
- Converts UTF-16 .string files downloaded from Transifex to UTF-8
so they are not considered binary files for versioning.
Change-Id: I52b498efe96773046959e51cf11b4e560dc78ecc
Reviewed-by: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
diff --git a/Ring/update-translations.sh b/Ring/update-translations.sh
index 1c05716..8cf95d1 100755
--- a/Ring/update-translations.sh
+++ b/Ring/update-translations.sh
@@ -1,4 +1,22 @@
#!/bin/bash
-tx push -s
+# don't fail on unknown byte sequences
+export LC_CTYPE=C
+
tx pull -af --minimum-perc=1
+
+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