Adapt remove-unused-trans to gradle, yet to be tested

This commit is contained in:
Daniel Martí 2014-12-31 00:11:33 +01:00
parent 5dd4b8de1c
commit 0f5a49fdd4

View File

@ -2,12 +2,11 @@
# Remove extra translations
lint . --quiet --check ExtraTranslation --nolines | \
sed -n 's@res/values-[^/]\+/\([^\.]\+\)\.xml:.*Error: "\([^"]*\)" is translated here but not found in default locale.*@\1 \2@p' | \
while read file name; do
if [[ $file == strings ]]; then
sed -i "/name=\"$name\"/d" res/values-*/strings.xml
elif [[ $file == array ]]; then
sed -i "/<string-array name=\"$name\"/,/<\/string-array/d" res/values-*/array.xml
fi
done
sed -n 's@res/values-[^/]\+/\([^\.]\+\)\.xml:.*Error: "\([^"]*\)" is translated here but not found in default locale.*@\1 \2@p' < build/outputs/lint-results.txt | \
while read file name; do
if [[ $file == strings ]]; then
sed -i "/name=\"$name\"/d" res/values-*/strings.xml
elif [[ $file == array ]]; then
sed -i "/<string-array name=\"$name\"/,/<\/string-array/d" res/values-*/array.xml
fi
done