diff --git a/.github/workflows/tx-pull.yml b/.github/workflows/tx-pull.yml new file mode 100644 index 0000000..762683b --- /dev/null +++ b/.github/workflows/tx-pull.yml @@ -0,0 +1,31 @@ +on: + workflow_dispatch: + schedule: + - cron: "0 15 * * *" + +name: "🔄 Scheduled Transifex Update" + +jobs: + pull-translations-from-transifex: + name: pull-translations-from-transifex + + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - name: 🌐 Push source file using transifex client + uses: transifex/cli-action@v2 + with: + token: ${{ secrets.TRANSIFEX_TOKEN }} + args: pull --force --all + - name: 🔄 Create PR if necessary + uses: peter-evans/create-pull-request@v6.0.1 + with: + commit-message: "(chore) Update translations from Transifex" + title: "(chore) Update translations from Transifex" + body: "Automated updates of translations pulled from Transifex" + branch: "chore/update-transifex" + author: "OpenMRS Bot " + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tx-push.yml b/.github/workflows/tx-push.yml new file mode 100644 index 0000000..d2cd13d --- /dev/null +++ b/.github/workflows/tx-push.yml @@ -0,0 +1,21 @@ +on: + workflow_dispatch: + push: + branches: [main] + +name: "Update Transifex on Push" + +jobs: + push-translations-to-transifex: + name: push-translations-to-transifex + + runs-on: ubuntu-latest + permissions: + actions: read + + steps: + - uses: actions/checkout@v4 + - name: 📥 Push source file using transifex client + uses: transifex/cli-action@v2 + with: + token: ${{ secrets.TRANSIFEX_TOKEN }} diff --git a/.tx/config b/.tx/config index 3ec09a3..9d49894 100644 --- a/.tx/config +++ b/.tx/config @@ -1,7 +1,7 @@ [main] host = https://www.transifex.com -[o:openmrs:p:openmrs-esm-fast-data-entry-app:r:esm-fast-data-entry-app] +[o:openmrs:p:openmrs3:r:esm-fast-data-entry-app] file_filter = translations/.json source_file = translations/en.json source_lang = en @@ -9,4 +9,3 @@ type = KEYVALUEJSON minimum_perc = 0 replace_edited_strings = false keep_translations = false -resource_name = esm-fast-data-entry-app