mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
fix wrong text domain
This commit is contained in:
parent
3eb282f2a0
commit
c0e5fa4827
1 changed files with 35 additions and 38 deletions
|
@ -98,21 +98,21 @@ class SettingsRenderer {
|
||||||
*/
|
*/
|
||||||
public function messages() : array {
|
public function messages() : array {
|
||||||
|
|
||||||
$messages = array();
|
$messages = array();
|
||||||
|
|
||||||
if ($this->paypal_vaulting_is_enabled() || $this->pay_later_messaging_is_enabled()) {
|
if ( $this->paypal_vaulting_is_enabled() || $this->pay_later_messaging_is_enabled() ) {
|
||||||
$enabled = $this->paypal_vaulting_is_enabled() ? __('PayPal vaulting', 'woo-ecurring') : __('Pay Later Messaging', 'woo-ecurring');
|
$enabled = $this->paypal_vaulting_is_enabled() ? __( 'PayPal vaulting', 'woocommerce-paypal-payments' ) : __( 'Pay Later Messaging', 'woocommerce-paypal-payments' );
|
||||||
$disabled = $this->pay_later_messaging_is_enabled() ? __('PayPal vaulting', 'woo-ecurring') : __('Pay Later Messaging', 'woo-ecurring');
|
$disabled = $this->pay_later_messaging_is_enabled() ? __( 'PayPal vaulting', 'woocommerce-paypal-payments' ) : __( 'Pay Later Messaging', 'woocommerce-paypal-payments' );
|
||||||
|
|
||||||
$pay_later_messages_or_vaulting_text = sprintf(
|
$pay_later_messages_or_vaulting_text = sprintf(
|
||||||
__(
|
__(
|
||||||
'You have %1$s enabled, that\'s why %2$s is unavailable now. You cannot use both at the same time',
|
'You have %1$s enabled, that\'s why %2$s is unavailable now. You cannot use both at the same time',
|
||||||
'woo-ecurring'
|
'woocommerce-paypal-payments'
|
||||||
),
|
),
|
||||||
$enabled,
|
$enabled,
|
||||||
$disabled
|
$disabled
|
||||||
);
|
);
|
||||||
$messages[] = new Message($pay_later_messages_or_vaulting_text, 'warning');
|
$messages[] = new Message( $pay_later_messages_or_vaulting_text, 'warning' );
|
||||||
}
|
}
|
||||||
|
|
||||||
//phpcs:disable WordPress.Security.NonceVerification.Recommended
|
//phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||||
|
@ -124,55 +124,52 @@ class SettingsRenderer {
|
||||||
//phpcs:enable WordPress.Security.NonceVerification.Missing
|
//phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||||
|
|
||||||
$messages[] = new Message(
|
$messages[] = new Message(
|
||||||
__(
|
__(
|
||||||
'We could not complete the onboarding process. Some features, such as card processing, will not be available. To fix this, please try again.',
|
'We could not complete the onboarding process. Some features, such as card processing, will not be available. To fix this, please try again.',
|
||||||
'woocommerce-paypal-payments'
|
'woocommerce-paypal-payments'
|
||||||
),
|
),
|
||||||
'error',
|
'error',
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether PayPal vaulting is enabled.
|
* Check whether PayPal vaulting is enabled.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function paypal_vaulting_is_enabled(): bool
|
private function paypal_vaulting_is_enabled(): bool {
|
||||||
{
|
$saving_paypal_account_is_enabled = $this->settings->has( 'save_paypal_account' ) &&
|
||||||
$saving_paypal_account_is_enabled = $this->settings->has('save_paypal_account') &&
|
(bool) $this->settings->get( 'save_paypal_account' );
|
||||||
(bool) $this->settings->get('save_paypal_account');
|
|
||||||
|
|
||||||
$vault_is_enabled = $this->settings->has('vault_enabled') &&
|
$vault_is_enabled = $this->settings->has( 'vault_enabled' ) &&
|
||||||
(bool) $this->settings->get('vault_enabled');
|
(bool) $this->settings->get( 'vault_enabled' );
|
||||||
|
|
||||||
return $saving_paypal_account_is_enabled || $vault_is_enabled;
|
return $saving_paypal_account_is_enabled || $vault_is_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether Pay Later message is enabled either for checkout, cart or product page.
|
* Check whether Pay Later message is enabled either for checkout, cart or product page.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function pay_later_messaging_is_enabled(): bool
|
private function pay_later_messaging_is_enabled(): bool {
|
||||||
{
|
$pay_later_message_enabled_for_checkout = $this->settings->has( 'message_enabled' )
|
||||||
$pay_later_message_enabled_for_checkout = $this->settings->has('message_enabled')
|
&& (bool) $this->settings->get( 'message_enabled' );
|
||||||
&& (bool) $this->settings->get('message_enabled');
|
|
||||||
|
|
||||||
$pay_later_message_enabled_for_cart = $this->settings->has('message_cart_enabled')
|
$pay_later_message_enabled_for_cart = $this->settings->has( 'message_cart_enabled' )
|
||||||
&& (bool) $this->settings->get('message_cart_enabled');
|
&& (bool) $this->settings->get( 'message_cart_enabled' );
|
||||||
|
|
||||||
$pay_later_message_enabled_for_product = $this->settings->has('message_product_enabled')
|
$pay_later_message_enabled_for_product = $this->settings->has( 'message_product_enabled' )
|
||||||
&& (bool) $this->settings->get('message_product_enabled');
|
&& (bool) $this->settings->get( 'message_product_enabled' );
|
||||||
|
|
||||||
|
return $pay_later_message_enabled_for_checkout ||
|
||||||
return $pay_later_message_enabled_for_checkout ||
|
$pay_later_message_enabled_for_cart ||
|
||||||
$pay_later_message_enabled_for_cart ||
|
$pay_later_message_enabled_for_product;
|
||||||
$pay_later_message_enabled_for_product;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the multiselect field.
|
* Renders the multiselect field.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue