Skip to content

Commit 4bea43b

Browse files
authored
Bug fixes
1 parent 990e6b1 commit 4bea43b

3 files changed

Lines changed: 24 additions & 30 deletions

File tree

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Automatically regenerate .pot translation file on code changes
2-
# Triggered on pushes to main branch (excluding docs-only changes)
3-
# Creates a pull request if translations need updating
4-
51
name: Update Translation File
62

73
on:
@@ -25,31 +21,38 @@ jobs:
2521
update-pot:
2622
name: Regenerate .pot File
2723
runs-on: ubuntu-latest
28-
24+
2925
steps:
3026
- name: Checkout code
3127
uses: actions/checkout@v6
3228
with:
3329
fetch-depth: 0
34-
30+
3531
- name: Setup PHP
3632
uses: shivammathur/setup-php@v2
3733
with:
3834
php-version: '7.4'
39-
35+
4036
- name: Install WP-CLI
4137
run: |
4238
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
4339
chmod +x wp-cli.phar
4440
sudo mv wp-cli.phar /usr/local/bin/wp
4541
wp --version
46-
42+
43+
- name: Create WordPress Environment
44+
run: |
45+
cd /tmp
46+
wp core download --allow-root
47+
wp config create --dbname=wordpress --dbuser=root --dbpass=root --allow-root
48+
cd -
49+
4750
- name: Regenerate .pot file
4851
run: |
4952
wp i18n make-pot . languages/Free-Gift-Coupons-Bulk-Coupons-Generator.pot \
5053
--skip-audit \
5154
--exclude=vendor,node_modules,tests,build
52-
55+
5356
- name: Check for changes
5457
id: changes
5558
run: |
@@ -61,7 +64,7 @@ jobs:
6164
echo "✓ Translation file updated"
6265
git diff languages/Free-Gift-Coupons-Bulk-Coupons-Generator.pot | head -20
6366
fi
64-
67+
6568
- name: Create Pull Request
6669
if: steps.changes.outputs.has_changes == 'true'
6770
uses: peter-evans/create-pull-request@v8
@@ -70,28 +73,21 @@ jobs:
7073
title: 'chore(i18n): Update translation template (.pot file)'
7174
body: |
7275
## Translation Template Update
73-
76+
7477
This PR updates the translation template (`.pot` file) based on recent code changes.
75-
78+
7679
### What Changed
77-
The following PHP and JavaScript source files had translatable strings added or modified:
78-
79-
```
80-
${{ github.event.head_commit.message }}
81-
```
82-
80+
The following PHP and JavaScript source files had translatable strings added or modified.
81+
82+
See the diff in this PR for details.
83+
8384
### Next Steps
8485
1. Review the changes in the `.pot` file
8586
2. Approve and merge this PR
8687
3. Translators can then use the updated `.pot` file with their translation tools
87-
88+
8889
---
8990
*This PR was automatically generated by the [Update Translation File](https://github.com/${{ github.repository }}/blob/main/.github/workflows/update-pot-file.yml) workflow.*
9091
branch: chore/update-pot-file
9192
delete-branch: true
92-
labels: |
93-
chore
94-
i18n
95-
translations
96-
assignees: |
97-
${{ github.repository_owner }}
93+
labels: 'chore,i18n,translations'

includes/class-fgcbg-plugin.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,14 @@ public function enqueue_admin_scripts( $hook ) {
191191
'fgcbg_i18n',
192192
array(
193193
'ajax_url' => admin_url( 'admin-ajax.php' ),
194-
'nonce' => wp_create_nonce( 'fgcbg_ajax_nonce' ),
195-
'confirm_large_batch' => __( 'You are about to generate %d coupons. This may take a while and could potentially timeout depending on your server settings. Do you want to continue?', 'free-gift-coupons-bulk-coupons-generator' ),
194+
'nonce' => wp_create_nonce( 'fgcbg_ajax_nonce' ), /* translators: %d is the number of coupons to be generated */ 'confirm_large_batch' => __( 'You are about to generate %d coupons. This may take a while and could potentially timeout depending on your server settings. Do you want to continue?', 'free-gift-coupons-bulk-coupons-generator' ),
196195
'max_coupons_warning' => __( 'Maximum 100 coupons allowed', 'free-gift-coupons-bulk-coupons-generator' ),
197196
'many_coupons_warning' => __( 'Generating many coupons may take some time and could timeout', 'free-gift-coupons-bulk-coupons-generator' ),
198197
'select_product' => __( 'Please select at least one product.', 'free-gift-coupons-bulk-coupons-generator' ),
199198
'invalid_coupon_count' => __( 'Please enter a valid number of coupons (minimum 1).', 'free-gift-coupons-bulk-coupons-generator' ),
200199
'max_coupon_count' => __( 'Maximum number of coupons is 100.', 'free-gift-coupons-bulk-coupons-generator' ),
201200
'prefix_too_long' => __( 'Coupon prefix must be 10 characters or less.', 'free-gift-coupons-bulk-coupons-generator' ),
202-
'generation_in_progress' => __( 'Coupon generation is in progress. Are you sure you want to leave this page?', 'free-gift-coupons-bulk-coupons-generator' ),
203-
'generating_progress' => __( 'Generating coupons: %1$d of %2$d', 'free-gift-coupons-bulk-coupons-generator' ),
204-
'generation_complete' => __( 'Successfully generated %d coupons.', 'free-gift-coupons-bulk-coupons-generator' ),
201+
'generation_in_progress' => __( 'Coupon generation is in progress. Are you sure you want to leave this page?', 'free-gift-coupons-bulk-coupons-generator' ), /* translators: %1$d is the current coupon count, %2$d is the total number of coupons to generate */ 'generating_progress' => __( 'Generating coupons: %1$d of %2$d', 'free-gift-coupons-bulk-coupons-generator' ), /* translators: %d is the number of successfully generated coupons */ 'generation_complete' => __( 'Successfully generated %d coupons.', 'free-gift-coupons-bulk-coupons-generator' ),
205202
'generation_failed' => __( 'Failed to generate coupons. Please try again.', 'free-gift-coupons-bulk-coupons-generator' ),
206203
)
207204
);

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
level: 6
66
paths:
77
- free-gift-bulk-coupon-generator.php
8+
- includes/
89

910
excludePaths:
1011
- .github

0 commit comments

Comments
 (0)