2018-01-04 13:58:24 +03:00
|
|
|
#!/bin/bash
|
2017-12-15 13:45:53 +03:00
|
|
|
|
|
|
|
cd scripts/screenshots/
|
|
|
|
for i in $(find ../../fastlane | grep png) ; do
|
|
|
|
device=$(echo $i | cut -d"/" -f8 | sed s'#Screenshots##')
|
|
|
|
textID=$(echo $i | cut -d"/" -f9 | cut -d"_" -f1,2)
|
|
|
|
locale=$(echo $i | cut -d"/" -f6)
|
|
|
|
|
|
|
|
# handle some locales different
|
|
|
|
case $locale in
|
|
|
|
"en-US")
|
|
|
|
locale=""
|
|
|
|
;;
|
|
|
|
*)
|
2018-01-04 13:58:24 +03:00
|
|
|
locale="-"$locale
|
2017-12-15 13:45:53 +03:00
|
|
|
esac
|
|
|
|
|
2018-01-04 13:58:24 +03:00
|
|
|
if [ -e ../../src/main/res/values$locale/strings.xml ] ; then
|
|
|
|
text=$(grep $textID ../../src/main/res/values$locale/strings.xml | cut -d">" -f2 | cut -d"<" -f1 | sed s'#\&#\\&#')
|
|
|
|
else
|
|
|
|
text=""
|
|
|
|
fi
|
2017-12-15 13:45:53 +03:00
|
|
|
|
|
|
|
# fallback to english if there is not translation
|
2018-01-04 13:58:24 +03:00
|
|
|
if [ -n $text ]; then
|
2017-12-15 13:45:53 +03:00
|
|
|
text=$(grep $textID ../../src/main/res/values/strings.xml | cut -d">" -f2 | cut -d"<" -f1 | sed s'#\&#\\&#')
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
sed "s#{image}#$i#;s#{text}#$text#g" $device.svg > temp.svg
|
|
|
|
|
|
|
|
if [ $textID == "06_davdroid" ] ; then
|
|
|
|
sed "s#display:none#display:visible#" -i temp.svg
|
|
|
|
fi
|
|
|
|
|
|
|
|
inkscape temp.svg -e $i
|
|
|
|
done
|