Skip to content

Commit

Permalink
Add a translation workflow for JS translations (#182)
Browse files Browse the repository at this point in the history
* Update Theme.Json Schema

* Lint Webpack-Config

* Generate POT files

* Bootstrap a demo block

* Generate JSON files

* Establish a proper js i18n workflow

* Update PHP to 8.1 in workflows
  • Loading branch information
Luehrsen authored Mar 23, 2023
1 parent 889d697 commit 0975bc0
Show file tree
Hide file tree
Showing 24 changed files with 5,873 additions and 9,925 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: ⚙️ Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2

- name: 💾 Get node.js cache directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: ⚙️ Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2

- name: ⚙️ Get project slug
Expand Down
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"phpcompatibility/php-compatibility": "^9.3",
"wp-coding-standards/wpcs": "^2.3",
"wptrt/wpthemereview": "dev-develop",
"phpcompatibility/phpcompatibility-wp": "^2.1"
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-cli/wp-cli-bundle": "^2.7"
},
"scripts": {
"lint": "phpcs -d memory_limit=-1",
Expand All @@ -22,7 +23,15 @@
"post-update-cmd": [
"cd theme && composer update",
"cd plugin && composer update"
]
],
"i18n-make-pot": [
"wp i18n make-pot ./theme ./theme/languages/lhpbpt.pot --exclude=vendor,node_modules,src",
"wp i18n make-pot ./plugin ./plugin/languages/lhpbpp.pot --exclude=vendor,node_modules,src,blocks/**/*.js"
],
"i18n-make-json": [
"wp i18n make-json \"./theme/languages/\" --no-purge",
"wp i18n make-json \"./plugin/languages/\" --no-purge"
]
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit 0975bc0

Please sign in to comment.