diff --git a/scripts/generateFilelist.sh b/scripts/generateFilelist.sh index 1a916412..066b6a2e 100755 --- a/scripts/generateFilelist.sh +++ b/scripts/generateFilelist.sh @@ -8,8 +8,15 @@ fi DIFF=$(git diff -U0 HEAD~$1 ${@:2} | grep -E "^\+" | grep -v +++ | cut -c 2- | sed 's/^[ \t]*\(.*$\)/\1/') echo "$DIFF" | xmlstarlet sel -t -m '//string' -v . -n > changed_texts.txt TRANSLATIONS=$(cat changed_texts.txt) -TRANSLATIONS="${TRANSLATIONS//'%'/' ; '}" + + TRANSLATIONS="${TRANSLATIONS//$'\n'/' ; '}" TRANSLATIONS="${TRANSLATIONS//$'\r'/' ; '}" -TRANSLATIONS="${TRANSLATIONS//$'\$'/''}" + +# First, replace all string-substitutions +TRANSLATIONS=$(echo $TRANSLATIONS | sed 's/%1$s//g') +TRANSLATIONS=$(echo $TRANSLATIONS | sed 's/%d//g') +TRANSLATIONS=$(echo $TRANSLATIONS | sed 's/%s//g') +TRANSLATIONS=$(echo $TRANSLATIONS | sed 's/"//g') + echo $TRANSLATIONS \ No newline at end of file