mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Localize strings
This commit is contained in:
parent
86e55b6274
commit
8b96613339
6 changed files with 19 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { createElement } from '@wordpress/element';
|
import { createElement } from '@wordpress/element';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
const CardChangeButton = ( { onChangeButtonClick } ) =>
|
const CardChangeButton = ( { onChangeButtonClick } ) =>
|
||||||
createElement(
|
createElement(
|
||||||
|
@ -12,7 +13,7 @@ const CardChangeButton = ( { onChangeButtonClick } ) =>
|
||||||
onChangeButtonClick();
|
onChangeButtonClick();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'Choose a different card'
|
__( 'Choose a different card', 'woocommerce-paypal-payments' )
|
||||||
);
|
);
|
||||||
|
|
||||||
export default CardChangeButton;
|
export default CardChangeButton;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { STORE_NAME } from '../../stores/axoStore';
|
import { STORE_NAME } from '../../stores/axoStore';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
const EmailButton = ( { handleSubmit } ) => {
|
const EmailButton = ( { handleSubmit } ) => {
|
||||||
const { isGuest, isAxoActive, isEmailSubmitted } = useSelect(
|
const { isGuest, isAxoActive, isEmailSubmitted } = useSelect(
|
||||||
|
@ -29,7 +30,7 @@ const EmailButton = ( { handleSubmit } ) => {
|
||||||
visibility: isEmailSubmitted ? 'hidden' : 'visible',
|
visibility: isEmailSubmitted ? 'hidden' : 'visible',
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
Continue
|
{ __( 'Continue', 'woocommerce-paypal-payments' ) }
|
||||||
</span>
|
</span>
|
||||||
{ isEmailSubmitted && (
|
{ isEmailSubmitted && (
|
||||||
<span
|
<span
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { useEffect, useCallback } from '@wordpress/element';
|
import { useEffect, useCallback } from '@wordpress/element';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
import { Card } from '../Card';
|
import { Card } from '../Card';
|
||||||
import { STORE_NAME } from '../../stores/axoStore';
|
import { STORE_NAME } from '../../stores/axoStore';
|
||||||
|
|
||||||
|
@ -32,7 +33,10 @@ export const Payment = ( { fastlaneSdk, card, onPaymentLoad } ) => {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div id="ppcp-axo-block-radio-content">
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
|
const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
|
||||||
<a
|
<a
|
||||||
className="wc-block-axo-change-link"
|
className="wc-block-axo-change-link"
|
||||||
|
@ -7,7 +9,10 @@ const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
|
||||||
onChangeShippingAddressClick();
|
onChangeShippingAddressClick();
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
Choose a different shipping address
|
{ __(
|
||||||
|
'Choose a different shipping address',
|
||||||
|
'woocommerce-paypal-payments'
|
||||||
|
) }
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -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';
|
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
|
@ -76,7 +77,7 @@ const Axo = ( props ) => {
|
||||||
onChangeButtonClick={ onChangeCardButtonClick }
|
onChangeButtonClick={ onChangeCardButtonClick }
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div>Loading Fastlane...</div>
|
<>{ __( 'Loading Fastlane…', 'woocommerce-paypal-payments' ) }</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ registerPaymentMethod( {
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
content: <Axo />,
|
content: <Axo />,
|
||||||
edit: <h1>This is Axo Blocks in the editor</h1>,
|
edit: createElement( ppcpConfig.title ),
|
||||||
ariaLabel: ppcpConfig.title,
|
ariaLabel: ppcpConfig.title,
|
||||||
canMakePayment: () => true,
|
canMakePayment: () => true,
|
||||||
supports: {
|
supports: {
|
||||||
|
|
|
@ -243,7 +243,6 @@ class AxoBlockPaymentMethod extends AbstractPaymentMethodType {
|
||||||
),
|
),
|
||||||
'logging_enabled' => $this->settings->has( 'logging_enabled' ) ? $this->settings->get( 'logging_enabled' ) : '',
|
'logging_enabled' => $this->settings->has( 'logging_enabled' ) ? $this->settings->get( 'logging_enabled' ) : '',
|
||||||
'wp_debug' => defined( 'WP_DEBUG' ) && WP_DEBUG,
|
'wp_debug' => defined( 'WP_DEBUG' ) && WP_DEBUG,
|
||||||
'billing_email_button_text' => __( 'Continue', 'woocommerce-paypal-payments' ),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue