When using localizable.strings with many entries in your XCode project you sooner or later may use a key more than once. Is it possible to let XCode find that case and issue a w
more Filename.strings | tr -d ' ' | sort | uniq -d | grep -v '^$'
cut -d' ' -f1 Localizable.strings | sort | uniq -c
type this command in the terminal and you get a list saying how often each key is used.
use -d instead of -c and you only get duplicates
#!/bin/bash
c=`expr $SCRIPT_INPUT_FILE_COUNT - 1`
for i in $(seq 0 $c)
do
var="SCRIPT_INPUT_FILE_$i"
FILENAME=${!var}
DUPES=`cut -d' ' -f1 "$FILENAME" | sort | uniq -d`
while read -r line; do
if [[ $line == "\""* ]] ;
then
echo "warning: $line used multiple times -"
fi
done <<< "$DUPES"
done
cut -d'=' -f1 Localizable.strings | sort | uniq -d
You looking phrases separated by equal sign, not a first word in each string.