Skip to content

Commit 8f0e8ae

Browse files
authored
Enhance i18n:check task (#1578)
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.
1 parent 55ad9ec commit 8f0e8ae

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: .github/workflows/check-i18n-task.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@ jobs:
3232
repo-token: ${{ secrets.GITHUB_TOKEN }}
3333
version: 3.x
3434

35-
- name: Check i18n source file is up to date
35+
- name: Check i18n source and translation files are up to date
3636
run: task i18n:check
37+
env:
38+
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
39+
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
40+
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}

Diff for: Taskfile.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ tasks:
266266
cmds:
267267
- task: go:vet
268268
- task: go:lint
269-
- task: i18n:check
270269
- task: python:lint
271270
- task: protoc:check
272271

@@ -299,7 +298,7 @@ tasks:
299298
i18n:check:
300299
desc: Check if the i18n message catalog was updated
301300
cmds:
302-
- task: i18n:update
301+
- task: i18n:pull
303302
- git add -N ./i18n/data
304303
- git diff --exit-code ./i18n/data
305304

0 commit comments

Comments
 (0)