Commit 4f187a31 authored by Alexandre Lision's avatar Alexandre Lision Committed by Guillaume Roguez

translations: fix update script

- file command has not the same option on Mac and Linux (-I versus -i)
- use force mode (-f) to pull every modifications

Issue: #81336
Change-Id: I67d8f791a530757f623b361c13b1bd3cbe9aeb2c
parent 6731e132
...@@ -23,16 +23,23 @@ ...@@ -23,16 +23,23 @@
# Get the translations from Transifex # Get the translations from Transifex
# TODO: add contraints on what we pull # TODO: add contraints on what we pull
tx pull -a --minimum-perc=75
if [ "$(uname)" == "Darwin" ]; then
option="-I"
else
option="-i"
fi
tx pull -af --minimum-perc=75
cd ui/ cd ui/
for dir in '$(find . -name "*.lproj" -type d)'; do for dir in `find . -name "*.lproj" -type d`; do
cd $dir cd $dir
echo "$dir..." echo "$dir..."
# in each country dir cleanup the files # in each country dir cleanup the files
for file in `find . -name '*.strings'`; do for file in `find . -name '*.strings'`; do
# Convert file if encoding is utf-16le # Convert file if encoding is utf-16le
if [ `file -I $file | awk '{print $3;}'` = "charset=utf-16le" ]; then if [ `file $option $file | awk '{print $3;}'` = "charset=utf-16le" ]; then
echo "Converting $file..." echo "Converting $file..."
iconv -f UTF-16LE -t UTF-8 $file > $file.8 iconv -f UTF-16LE -t UTF-8 $file > $file.8
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment