diff --git a/.github/workflows/wp-i18n.yml b/.github/workflows/wp-i18n.yml index 1c042c08..f44b16c0 100644 --- a/.github/workflows/wp-i18n.yml +++ b/.github/workflows/wp-i18n.yml @@ -64,11 +64,24 @@ 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: Get current timestamp for .pot header + id: date + run: echo "TIMESTAMP=${date('%Y-%m-%dT%H:%M:%S')}+00:00 >> $GITHUB_OUTPUT + - 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 + 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":${{ steps.date.outputs.TIMESTAMP }}}' --exclude=assets,tests,src - name: Check if there are file changes id: changes diff --git a/composer.json b/composer.json index e6a75a28..e1363f8d 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,7 @@ "scripts": { "fix": "vendor/bin/phpcbf --standard=phpcs.xml .", "lint": "vendor/bin/phpcs --standard=phpcs.xml -s .", - "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": "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", }, "scripts-descriptions": { "fix": "Automatically fix coding standards issues where possible.",