Skip to content

Commit ed4b7c6

Browse files
authored
Merge pull request #237 from newfold-labs/PRESS11-157
Integrate Reusable Azure AI Translation Workflow from Central Repository
2 parents 807e461 + 0059d01 commit ed4b7c6

File tree

4 files changed

+38
-25
lines changed

4 files changed

+38
-25
lines changed

.github/workflows/auto-translate.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check for Updates to Translations
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
workflow_dispatch:
8+
9+
# Cancels all previous workflow runs for the branch that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name.
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
permissions: {}
16+
17+
jobs:
18+
translate:
19+
name: 'Check and update translations'
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
uses: newfold-labs/workflows/.github/workflows/reusable-translations.yml@main
24+
with:
25+
text_domain: 'wp-module-performance'
26+
i18n-script-location: 'npm'
27+
secrets:
28+
TRANSLATOR_API_KEY: ${{ secrets.TRANSLATOR_API_KEY }}

.github/workflows/i18n-update.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@
5454
"i18n": [
5555
"@i18n-pot",
5656
"@i18n-po",
57-
"@i18n-mo",
57+
"@i18n-json",
58+
"@i18n-php"
59+
],
60+
"i18n-ci-pre": [
61+
"@i18n-pot",
62+
"@i18n-po"
63+
],
64+
"i18n-ci-post": [
5865
"@i18n-json",
5966
"@i18n-php"
6067
],

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"i18n-build": "composer run-script i18n",
4646
"i18n-rename-json": "node ./translations-json-rename.js",
4747
"i18n": "npm run -s i18n-build && npm run i18n-rename-json",
48+
"i18n-ci-pre": "composer run-script i18n-ci-pre",
49+
"i18n-ci-post": "composer run-script i18n-ci-post && npm run i18n-rename-json",
4850
"lint-js": "wp-scripts lint-js"
4951
}
5052
}

0 commit comments

Comments
 (0)