Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/i18n workflow #559

Merged
merged 6 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions .github/workflows/wp-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,9 @@ jobs:
continue-on-error: true
run: git diff --exit-code

- name: Commit updated language files
- name: Fail if language files have changes
if: steps.changes.outcome == 'failure'
run: |
git config --local user.name "${GITHUB_ACTOR} "
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote -v
git add './languages'
git commit -m "WordPress I18N triggered by commit ${{ github.sha }}"
git status

- name: Push changes
if: steps.changes.outcome == 'failure'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
echo "i18n files are out of date"
echo "Please run command (composer run i18n) locally to update them and commit before releasing"
exit 1
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
}
},
"require-dev": {
"newfold-labs/wp-php-standards": "^1.2",
"newfold-labs/wp-php-standards": "^1.2.3",
"wp-cli/i18n-command": "^2.6.1",
"wp-phpunit/wp-phpunit": "^6.4.2"
"wp-phpunit/wp-phpunit": "^6.5.3"
},
"scripts": {
"fix": "vendor/bin/phpcbf --standard=phpcs.xml .",
Expand All @@ -54,11 +54,11 @@
"i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-plugin-hostgator.pot ./languages",
"i18n-mo": "vendor/bin/wp i18n make-mo ./languages",
"i18n-json": "vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n-json-rename": "for f in ./languages/*.json; do mv \"$f\" \"$(echo \"$f\" | sed 's/[0-9a-fA-F]\\{32\\}/hostgator-script/')\"; done",
"i18n": [
"@i18n-pot",
"@i18n-po",
"@i18n-mo"
"@i18n-mo",
"@i18n-json"
]
},
"scripts-descriptions": {
Expand All @@ -68,8 +68,7 @@
"i18n-pot": "Generate a .pot file for translation.",
"i18n-po": "Update existing .po files.",
"i18n-mo": "Generate new language .mo files.",
"i18n-json": "Generate new language .json files.",
"i18n-json-rename": "Rename the language json files to remove the pesky hash."
"i18n-json": "Generate new language .json files."
},
"require": {
"doctrine/inflector": "1.4.4 as 1.3.1",
Expand All @@ -80,7 +79,7 @@
"newfold-labs/wp-module-deactivation": "^1.1.2",
"newfold-labs/wp-module-ecommerce": "^1.3.30",
"newfold-labs/wp-module-global-ctb": "^1.0.11",
"newfold-labs/wp-module-help-center": "^1.0.24",
"newfold-labs/wp-module-help-center": "^1.0.25",
"newfold-labs/wp-module-loader": "^1.0.10",
"newfold-labs/wp-module-marketplace": "^2.2.4",
"newfold-labs/wp-module-notifications": "^1.3.0",
Expand All @@ -89,7 +88,7 @@
"newfold-labs/wp-module-performance": "^1.4.1",
"newfold-labs/wp-module-runtime": "^1.0.11",
"newfold-labs/wp-module-secure-passwords": "^1.1.1",
"newfold-labs/wp-module-sso": "^1.0.4",
"newfold-labs/wp-module-sso": "^1.0.5",
"newfold-labs/wp-module-staging": "^1.3.3",
"wp-forge/wp-update-handler": "^1.0.2",
"wp-forge/wp-upgrade-handler": "^1.0"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading