From 1e52dbb19807d085e08c7c4360c13c157bee7cb0 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Thu, 2 Dec 2021 10:07:49 +0100 Subject: [PATCH] Enhance i18n:check task i18n:check task used to verify only if the source en.po file was up to date. The new process instead verifies that all translations are up to date by downloading them directly from Transifex. The previous process was causing some issues since after uploading the en.po file Transifex would change its formatting, meaning when calling i18n:pull we would download a file containing the same information but formatted in a different way and that made the i18n:check command fail. By making the i18n:check task call i18n:pull instead of i18n:update we don't have issues with the formatting anymore. This change also covers a corner-case that would occur when the en.po file wasn't updated since a long time, the i18n:check wouldn't fail because the en.po was the same as before but that wouldn't mean that the translations were up to date with the latest from Transifex. --- .github/workflows/check-i18n-task.yml | 6 +++++- Taskfile.yml | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-i18n-task.yml b/.github/workflows/check-i18n-task.yml index 3d7689aa6f9..993c05ac274 100644 --- a/.github/workflows/check-i18n-task.yml +++ b/.github/workflows/check-i18n-task.yml @@ -32,5 +32,9 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x - - name: Check i18n source file is up to date + - name: Check i18n source and translation files are up to date run: task i18n:check + env: + TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }} + TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }} + TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }} diff --git a/Taskfile.yml b/Taskfile.yml index 015d4b61484..70d0e60402f 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -266,7 +266,6 @@ tasks: cmds: - task: go:vet - task: go:lint - - task: i18n:check - task: python:lint - task: protoc:check @@ -299,7 +298,7 @@ tasks: i18n:check: desc: Check if the i18n message catalog was updated cmds: - - task: i18n:update + - task: i18n:pull - git add -N ./i18n/data - git diff --exit-code ./i18n/data