diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-03-21 10:55:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 10:55:14 +0300 |
commit | 8ef0cb5ba65bfc2c41b427d35c0a175322ee4f39 (patch) | |
tree | 52788825a8ec4706126d85bfb0d33762f76a521b /.github | |
parent | 475239982149c50f35141a21da37108b1cd7b0ef (diff) |
fix automatic translation update for special languages
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/translations.yml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 2148d2b2d4..254bdc8398 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -64,8 +64,10 @@ jobs: - name: Check for changes id: changes run: | + git add lang/ + git add "*.json" IFS=$'\n' - changes=( $(git diff --numstat | grep -E '([0-9]+)\s+([0-9]+)\s+[a-zA-Z\/]*lang\/([a-z]{2,3}(?:-[a-z]{2,3})?)\.json' ) ) + changes=( $(git diff --numstat HEAD | grep -E '([0-9]+)\s+([0-9]+)\s+[a-zA-Z\/]*lang\/([a-z]{2,3}(-[a-z]{2,3})?)\.json' ) ) unset IFS # abort here if no change available @@ -74,9 +76,6 @@ jobs: exit 0 fi - git add lang/ - git add "*.json" - declare -i totaladditions=0 declare -A additionsByLang @@ -90,7 +89,7 @@ jobs: fi file=${line[2]} - lang=$( echo ${line[2]} | grep -oE '([a-z]{2,3}(?:-[a-z]{2,3})?)\.json' | cut -d'.' -f 1 ) + lang=$( echo ${line[2]} | grep -oE '([a-z]{2,3}(-[a-z]{2,3})?)\.json' | cut -d'.' -f 1 ) totaladditions=$(( totaladditions + additions )) additionsByLang[$lang]=$(( additionsByLang[$lang] + additions )) @@ -98,7 +97,7 @@ jobs: title="Updated $totaladditions strings in ${#additionsByLang[@]} languages (${!additionsByLang[@]})" - languageInfo=( $( ./console translations:languageinfo ) ) + languageInfo=( $( ./console translations:languageinfo | tr " " "_" ) ) for i in ${!additionsByLang[@]}; do for j in ${languageInfo[@]}; do @@ -111,7 +110,8 @@ jobs: fi done - message="$message- Updated ${info[1]} (${additionsByLang[$i]} changes / ${info[2]} translated)\n" + name=$( echo ${info[1]} | tr "_" " " ) + message="$message- Updated $name (${additionsByLang[$i]} changes / ${info[2]} translated)\n" done message="$message\n\nHelp us translate Matomo in your language!\nSignup at https://www.transifex.com/matomo/matomo/\nIf you have any questions, get in touch with us at translations@matomo.org" |