Add support for arrays in remove-unused-trans
This commit is contained in:
parent
0ff1257aef
commit
5292acfef0
@ -3,7 +3,11 @@
|
||||
# Remove extra translations
|
||||
|
||||
lint . --quiet --check ExtraTranslation --nolines | \
|
||||
sed -n 's/.*Error: "\([^"]*\)" is translated here but not found in default locale.*/\1/p' | \
|
||||
while read name; do
|
||||
sed -i "/name=\"$name\"/d" res/values-*/strings.xml
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user