Skip to content

Commit

Permalink
filter generated translation list
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Apr 28, 2024
1 parent e02f475 commit c9e3239
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/generateFilelist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ fi
DIFF=$(git diff -U0 HEAD~$1 ${@:2} | grep -E "^\+" | grep -v +++ | cut -c 2- | sed 's/^[ \t]*\(.*$\)/\1/')
echo "<xml>$DIFF</xml>" | 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

0 comments on commit c9e3239

Please sign in to comment.