Translation Issues
-
Hello, I found 2 other bugs, and a possible fix for one of them.
The first one concerns translation: I translated some strings in my language using Loco Translate plugin(after updating pot file), and noticed that the translated strings are never shown. So I inspected the code, debugging the function set_locale in class
includes/class-smart-paypal-checkout-for-woocommerce.php, at this line
$this->loader->add_action(‘plugins_loaded’, $plugin_i18n, ‘load_plugin_textdomain’);
I found that the callbak associated to hook ‘plugins_loaded’ is never reached.
I’ve tried changing the hook in ‘init’, and this worked for most of the strings, but not for all. For example the string ‘You’re almost done! Review your information before you place your order.’ remains untranslated.
Replacing the whole line above with a direct call to i18n method like this:
$plugin_i18n->load_plugin_textdomain();
seems to work instead, although I don’t know if it’s the right way to proceed.The second bug is in the management of mandatory fields of the checkout. In particular, I’ve set the phone number as mandatory, going on Appearance->Customize->WooCommerce->Payment, and this works fine, except if I make a Paypal Checkout on the product page or cart page, that is before reaching checkout.
In fact I found that in the class
public/class-smart-paypal-checkout-for-woocommerce-button-manager.php
the function filter_billing_fields() contains this code:
if (array_key_exists(‘billing_phone’, $billing_fields)) {
$billing_fields[‘billing_phone’][‘required’] = false;
}I can’t figure out what purpose this code was inserted for, but as a temporary patch I added in my theme functions.php an additional function to refilter fields with
$data[‘billing_phone’][‘required’]=true;
- The topic ‘Translation Issues’ is closed to new replies.