Skip to content

Commit

Permalink
Merge branch 'develop' into release/2.6.0
Browse files Browse the repository at this point in the history
* develop: (46 commits)
  update notifications module and other packages
  update coming soon and use new admin bar toggle method
  NPM(deps): Bump react-use from 17.4.2 to 17.4.3
  manually remove temp translation strings
  only run i18n workflow only on PRs to main and remove TEMP CODE
  WordPress I18N triggered by commit 5a4576a
  remove rename language step
  fix borked json file
  try json i18n steps one more time
  add `loremipsum` i18n string to test i18n worklfow stop - TEMP CODE
  only rename json files if there are changes
  try json-rename step by using bash shell
  use composer date in pot file and remove hashed json language files
  use consistent creation time - so we don't create new language files in every commit
  remove unecessary workflow step
  WordPress I18N triggered by commit 6310f9c
  composer update
  fix composer and have workflow commit all `./languages/` file changes.
  update i18n commands to also update mo and json files
  add composer script for pot and po files and bundle in i18n script. update po and pot files
  ...

# Conflicts:
#	composer.json
#	composer.lock
  • Loading branch information
circlecube committed Jan 16, 2024
2 parents edd9172 + b286902 commit a61d544
Show file tree
Hide file tree
Showing 21 changed files with 1,871 additions and 1,051 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/wp-i18n.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: WP Internationalization
on:
push:
pull_request:
types: [ opened, edited, reopened, ready_for_review, synchronize ]
branches:
- '**'
pull_request:
types: [ opened, edited, synchronize, reopened, ready_for_review ]
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
Expand Down Expand Up @@ -64,24 +63,36 @@ jobs:
- name: Install PHP Dependencies
run: composer install --no-progress --optimize-autoloader

- name: Setup Registry
run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc

- name: NPM Install
run: npm install --legacy-peer-deps

- name: Build JavaScript
run: npm run build

- name: Remove token
run: git checkout -- '.npmrc'

- name: Add text domains
run: npx node-wp-i18n addtextdomain

- name: Generate POT file
run: vendor/bin/wp i18n make-pot . ./languages/${{ github.event.repository.name }}.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.repository }}/issues","POT-Creation-Date":null}' --exclude=assets,storybook,tests,src
- name: Generate language files
run: composer run-script i18n

- name: Check if there are file changes
id: changes
continue-on-error: true
run: git diff --exit-code

- name: Commit web files
- name: Commit updated language files
if: steps.changes.outcome == 'failure'
run: |
git config --local user.name "${{ github.event.head_commit.author.name }}"
git config --local user.email "${{ github.event.head_commit.author.email }}"
git remote -v
git add -A
git add './languages'
git commit -m "WordPress I18N triggered by commit ${{ github.sha }}"
git status
Expand Down
3 changes: 0 additions & 3 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ function() {

// Required files
require HOSTGATOR_PLUGIN_DIR . '/inc/Admin.php';
require HOSTGATOR_PLUGIN_DIR . '/inc/AdminBar.php';
require HOSTGATOR_PLUGIN_DIR . '/inc/base.php';
require HOSTGATOR_PLUGIN_DIR . '/inc/jetpack.php';
require HOSTGATOR_PLUGIN_DIR . '/inc/LoginRedirect.php';
Expand All @@ -159,5 +158,3 @@ function() {
if ( is_admin() ) {
new Admin();
}

AdminBar::init();
30 changes: 21 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,39 @@
"scripts": {
"fix": "vendor/bin/phpcbf --standard=phpcs.xml .",
"lint": "vendor/bin/phpcs --standard=phpcs.xml -s .",
"i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-plugin-hostgator.pot --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/newfold-labs/wp-plugin-hostgator/issues\",\"POT-Creation-Date\":\"2023-01-11T20:21:44+00:00\"}' --exclude=assets,tests,src",
"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": [
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-hostgator.pot --headers=Report-Msgid-Bugs-To:https://github.com/newfold-labs/wp-plugin-hostgator/issues --exclude=assets,storybook,tests,src",
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-hostgator.pot --headers=POT-Creation-Date:null --exclude=assets,storybook,tests,src"
"@i18n-pot",
"@i18n-po",
"@i18n-mo"
]
},
"scripts-descriptions": {
"fix": "Automatically fix coding standards issues where possible.",
"lint": "Check files against coding standards.",
"i18n": "Generate a .pot file for translation."
"i18n": "Generate new language files.",
"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."
},
"require": {
"doctrine/inflector": "1.4.4 as 1.3.1",
"newfold-labs/wp-module-coming-soon": "^1.1.12",
"newfold-labs/wp-module-data": "^2.4.15",
"newfold-labs/wp-module-deactivation": "^1.0.3",
"newfold-labs/wp-module-ecommerce": "^1.3.12",
"newfold-labs/wp-module-coming-soon": "^1.1.15",
"newfold-labs/wp-module-data": "^2.4.16",
"newfold-labs/wp-module-deactivation": "^1.0.4",
"newfold-labs/wp-module-ecommerce": "^1.3.19",
"newfold-labs/wp-module-global-ctb": "^1.0.9",
"newfold-labs/wp-module-help-center": "^1.0.22",
"newfold-labs/wp-module-loader": "^1.0.10",
"newfold-labs/wp-module-marketplace": "^2.2.0",
"newfold-labs/wp-module-notifications": "^1.1.6",
"newfold-labs/wp-module-onboarding": "^1.11.13",
"newfold-labs/wp-module-notifications": "^1.2.2",
"newfold-labs/wp-module-onboarding": "^1.12.0",
"newfold-labs/wp-module-patterns": "^0.1.12",
"newfold-labs/wp-module-performance": "^1.3.0",
"newfold-labs/wp-module-runtime": "^1.0.7",
Expand Down
Loading

0 comments on commit a61d544

Please sign in to comment.