Merge pull request #2638 from woocommerce/axo-blocks-localize-strings

Axo Blocks: Localize strings
This commit is contained in:
Danny Dudzic 2024-09-25 15:38:01 +02:00 committed by GitHub
commit 24b10de76c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 8 deletions

View file

@ -1,4 +1,5 @@
import { createElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
const CardChangeButton = ( { onChangeButtonClick } ) =>
createElement(
@ -12,7 +13,7 @@ const CardChangeButton = ( { onChangeButtonClick } ) =>
onChangeButtonClick();
},
},
'Choose a different card'
__( 'Choose a different card', 'woocommerce-paypal-payments' )
);
export default CardChangeButton;

View file

@ -1,5 +1,6 @@
import { STORE_NAME } from '../../stores/axoStore';
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
const EmailButton = ( { handleSubmit } ) => {
const { isGuest, isAxoActive, isEmailSubmitted } = useSelect(
@ -29,7 +30,7 @@ const EmailButton = ( { handleSubmit } ) => {
visibility: isEmailSubmitted ? 'hidden' : 'visible',
} }
>
Continue
{ __( 'Continue', 'woocommerce-paypal-payments' ) }
</span>
{ isEmailSubmitted && (
<span

View file

@ -1,5 +1,6 @@
import { useEffect, useCallback } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { Card } from '../Card';
import { STORE_NAME } from '../../stores/axoStore';
@ -32,7 +33,10 @@ export const Payment = ( { fastlaneSdk, card, onPaymentLoad } ) => {
}
return (
<div id="ppcp-axo-block-radio-content">
Enter your email address above to continue.
{ __(
'Enter your email address above to continue.',
'woocommerce-paypal-payments'
) }
</div>
);
}

View file

@ -1,3 +1,5 @@
import { __ } from '@wordpress/i18n';
const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
<a
className="wc-block-axo-change-link"
@ -7,7 +9,10 @@ const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
onChangeShippingAddressClick();
} }
>
Choose a different shipping address
{ __(
'Choose a different shipping address',
'woocommerce-paypal-payments'
) }
</a>
);

View file

@ -1,4 +1,5 @@
import { useState } from '@wordpress/element';
import { useState, createElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
// Hooks
@ -76,7 +77,7 @@ const Axo = ( props ) => {
onChangeButtonClick={ onChangeCardButtonClick }
/>
) : (
<div>Loading Fastlane...</div>
<>{ __( 'Loading Fastlane…', 'woocommerce-paypal-payments' ) }</>
);
};
@ -89,7 +90,7 @@ registerPaymentMethod( {
/>
),
content: <Axo />,
edit: <h1>This is Axo Blocks in the editor</h1>,
edit: createElement( ppcpConfig.title ),
ariaLabel: ppcpConfig.title,
canMakePayment: () => true,
supports: {

View file

@ -243,7 +243,6 @@ class AxoBlockPaymentMethod extends AbstractPaymentMethodType {
),
'logging_enabled' => $this->settings->has( 'logging_enabled' ) ? $this->settings->get( 'logging_enabled' ) : '',
'wp_debug' => defined( 'WP_DEBUG' ) && WP_DEBUG,
'billing_email_button_text' => __( 'Continue', 'woocommerce-paypal-payments' ),
);
}
}