Browse Source

Skip TAGS_MISMATCH check if no English original exists

pull/1841/head
fbn_bmns 2 months ago
parent
commit
2ab2451072
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      tools/githooks/pre-commit

+ 5
- 0
tools/githooks/pre-commit View File

@ -127,6 +127,11 @@ for f in $files_all; do
ext="${f##*.}"
# Get base file name (without) "en.$EXT"
base=$(echo "${f}" | sed -E "s/\.[a-z][a-z]\.${ext}//")
# exit TAGS_MISMATCH check if no english original exists
if [[ ! -e "$base.en.$ext" ]]; then
echo "No english original found for $f, skipping TAGS_MISMATCH check.."
break
fi
# Extract tags from the translated and the English file, and sort them
tags_trans="$(grep -Ei '<tag(\s|\>)' "${f}" | perl -pe 's/.*<tag key="(.+?)".*/\1/' | sort)"
tags_en="$(grep -Ei '<tag(\s|\>)' "${base}.en.${ext}" | perl -pe 's/.*<tag key="(.+?)".*/\1/' | sort)"


Loading…
Cancel
Save