Skip to content

Commit

Permalink
Fix list_missing_translations.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Nov 23, 2022
1 parent c35a4b8 commit c6e01b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/list_missing_translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

list_translatable_keys() {
# Extracts the `name` attribute of every `<string>` tag in the `values-$1/strings.xml` file, except for the ones which have the `translatable='false'` attribute
xpath -q -e "//string[@translatable != 'false']/@name" WordPress/src/main/res/$1/strings.xml | sort | sed 's/^ *name="\(.*\)"$/\`\1\`/'
xpath -q -e "//string[@translatable != 'false']/@name" WordPress/src/main/res/$1/strings.xml | sed 's/^ *name="\(.*\)"$/\`\1\`/' | sort
}

list_diff() {
# Runs diff with a custom output format so that it can be used as a bullet-point list of missing entries
diff --unchanged-line-format="" --new-line-format="" --old-line-format=" - %L" "$@"
#diff --unchanged-line-format="" --new-line-format="" --old-line-format=" - %L" "$@" # Pre-macOS-Ventura `diff` options
diff --changed-group-format=" - %<" "$@" | grep '^ - '
}

ORIGINAL_KEYS_FILE="${TMPDIR}translatable-strings-originals-keys.txt"
Expand Down

0 comments on commit c6e01b9

Please sign in to comment.