Skip to content

Commit 0348bb0

Browse files
authored
Update Javascript linting config to specify expected text domain (#4578)
* Add linting rule for i18 text domain * Fix missing/wrong text domains * Changelog * Exclude more directories for JS linting * Sort entries * Move changelog entry to 9.9.0
1 parent c942e51 commit 0348bb0

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ module.exports = {
6262
'testing-library/no-unnecessary-act': 'off',
6363
'@typescript-eslint/no-empty-function': 'off',
6464
'@typescript-eslint/no-var-requires': 'off',
65+
'@wordpress/i18n-text-domain': [
66+
'error',
67+
{
68+
allowedTextDomain: 'woocommerce-gateway-stripe',
69+
},
70+
],
6571
},
6672
settings: {
6773
react: {
@@ -82,4 +88,11 @@ module.exports = {
8288
'@wordpress/data',
8389
],
8490
},
91+
ignorePatterns: [
92+
'build/**',
93+
'node_modules/**',
94+
'phpunit-html/**',
95+
'release/**',
96+
'vendor/**',
97+
],
8598
};

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Update - Increases the default font size for the Optimized Checkout payment element to match the rest of the checkout form
66
* Fix - Checks for the subscription payment method (if it is Stripe) when verifying for the payment method detachment
77
* Dev - Implements WooCommerce constants for the tax statuses
8+
* Fix - Ensure all Javascript strings use the correct text domain for translation
89

910
= 9.8.0 - 2025-08-11 =
1011
* Add - Adds the current setting value for the Optimized Checkout to the Stripe System Status Report data

client/settings/general-settings-section/payment-method-checkbox.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ const PaymentMethodCheckbox = ( {
100100
{ sprintf(
101101
/* translators: %s: a payment method name. */
102102
__(
103-
'%s cannot be enabled at checkout. Click to expand.'
103+
'%s cannot be enabled at checkout. Click to expand.',
104+
'woocommerce-gateway-stripe'
104105
),
105106
label
106107
) }

client/settings/stripe-account-connected-notice/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const StripeAccountConnectedNotice = () => {
4545
if ( shouldShowNotice() ) {
4646
localStorage.removeItem( LOCAL_STORAGE_KEY );
4747
dispatch( 'core/notices' ).createSuccessNotice(
48-
__( 'Stripe Account Connected', 'woocommerce' ),
48+
__( 'Stripe Account Connected', 'woocommerce-gateway-stripe' ),
4949
{
5050
id: 'WOOCOMMERCE_STRIPE_ACCOUNT_CONNECTED_NOTICE',
5151
actions: [

client/stripe-utils/cash-app-limit-notice-handler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const LIMIT_NOTICE_CLASSNAME = 'wc-block-checkout__payment-method-limit-notice';
1111
export const cashAppLimitNotice = document.createElement( 'div' );
1212
cashAppLimitNotice.classList.add( 'woocommerce-info', LIMIT_NOTICE_CLASSNAME );
1313
cashAppLimitNotice.textContent = __(
14-
'Please note that, depending on your account and transaction history, Cash App Pay may reject your transaction due to its amount.'
14+
'Please note that, depending on your account and transaction history, Cash App Pay may reject your transaction due to its amount.',
15+
'woocommerce-gateway-stripe'
1516
);
1617
cashAppLimitNotice.setAttribute( 'data-testid', 'cash-app-limit-notice' );
1718

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
115115
* Update - Increases the default font size for the Optimized Checkout payment element to match the rest of the checkout form
116116
* Fix - Checks for the subscription payment method (if it is Stripe) when verifying for the payment method detachment
117117
* Dev - Implements WooCommerce constants for the tax statuses
118+
* Fix - Ensure all Javascript strings use the correct text domain for translation
118119

119120
[See changelog for full details across versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)