v1.7.2: bug in “automatic language detection”
-
If you set “Language In Payment Window” to “Detect Automatically” the payment window is ALWAYS shown in English. And I think it’s a bug in the plugin:
Note that “Detect automatically” is defined as the empty string in ReepayCheckout.php:297
'' => __( 'Detect Automatically', 'reepay-checkout-gateway' )
Further note that the language setting is loaded in ReepayCheckout.php:76 and keep in mind that the short-versioned ternary operator
?:
interprets the empty string (== “Detect Automatically”) as false and will therefore not assign the empty string to$this->language
.$this->language = $this->settings['language'] ?: $this->language;
That is
$this->language
will be initialized with its current value, which is defined in ReepayGateway.php:94public $language = 'en_US';
Due to this mistake, the method get_language is never actually called and therefore neither is get_locale. Therefore the settings “Detect automatically” is effectively ignored and the payment window is shown in en_US, no matter the current WordPress locale.
This bug has existed since at least v1.7.0.
- The topic ‘v1.7.2: bug in “automatic language detection”’ is closed to new replies.