mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
Locale is now saved in DB
This commit is contained in:
parent
2938a5c6d4
commit
3aa81bd144
3 changed files with 46 additions and 62 deletions
|
@ -197,13 +197,6 @@ class SmartButton implements SmartButtonInterface {
|
|||
*/
|
||||
private $session_handler;
|
||||
|
||||
/**
|
||||
* The locale.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $locale;
|
||||
|
||||
/**
|
||||
* SmartButton constructor.
|
||||
*
|
||||
|
@ -227,7 +220,6 @@ class SmartButton implements SmartButtonInterface {
|
|||
* @param array $pay_now_contexts The contexts that should have the Pay Now button.
|
||||
* @param string[] $funding_sources_without_redirect The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back.
|
||||
* @param LoggerInterface $logger The logger.
|
||||
* @param string $locale The locale.
|
||||
*/
|
||||
public function __construct(
|
||||
string $module_url,
|
||||
|
@ -249,8 +241,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
bool $early_validation_enabled,
|
||||
array $pay_now_contexts,
|
||||
array $funding_sources_without_redirect,
|
||||
LoggerInterface $logger,
|
||||
string $locale
|
||||
LoggerInterface $logger
|
||||
) {
|
||||
|
||||
$this->module_url = $module_url;
|
||||
|
@ -1213,8 +1204,10 @@ class SmartButton implements SmartButtonInterface {
|
|||
$params['enable-funding'] = implode( ',', array_unique( $enable_funding ) );
|
||||
}
|
||||
|
||||
if ( $this->settings->has( 'smart_button_locale_override' ) && $this->settings->get( 'smart_button_locale_override' ) ) {
|
||||
$params['locale'] = $this->locale;
|
||||
$locale = $this->settings->has( 'smart_button_language' ) ? $this->settings->get( 'smart_button_language' ) : '';
|
||||
|
||||
if ( $locale ) {
|
||||
$params['locale'] = $locale;
|
||||
}
|
||||
|
||||
return $params;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue