#!/bin/bash # Before launching: # - Copy the Base.lproj/Localizable.string to the same dir than this file # - In the project Dir: Remove all strings files (rm -rf *.lproj) # - Fill PROJECT_DIRECTORY PROJECT_DIRECTORY= echo "" > ./Localizable_results.txt echo "" > ./Localizable_results_found.txt echo "" > ./Localizable_results_not_found.txt while read p; do # Get lines one by one line=`echo "$p" | sed -e 's/ = ".*//g' -e 's/\/\*.*//g' -e 's/\/\/.*//g'` # Remove ` = "..."` + comments if [[ ! -z $line ]] # Skip empty lines then res=`grep -Rn "$line" $PROJECT_DIRECTORY` # Find String in project echo "$res" >> ./Localizable_results.txt if [[ ! -z $res ]] then echo "$line" >> ./Localizable_results_found.txt else echo "$line" >> ./Localizable_results_not_found.txt fi echo "" >> ./Localizable_results.txt fi done < ./Localizable.strings