• Resolved Eugenijus

    (@ugenijus)


    Hello,

    It is impossible to translate button “CHECKOUT WITH PAYPAL”. This text is translated with Loco plugin, but checkout button shows only in english.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @ugenijus,

    The text for “Checkout With PayPal” is stored in a javascript variable using WordPress’s standard enqueue library. The text is created using the standard translate function __($string, $domain) which the whole plugin uses. You may want to contact the developers of the Loco plugin and ask them how they are translating and also how they switch between languages.

    Are you perhaps changing the language on the checkout page and it’s not updating the button text? If so the Loco plugin may be using ajax to update the language instead of a page refresh.

    Kind Regards,

    Plugin Author Payment Plugins

    (@mrclayton)

    @ugenijus,

    We haven’t heard from you in a while so I will mark this issue as resolved. Please respond if you are still having issues.

    Thanks,

    Thread Starter Eugenijus

    (@ugenijus)

    Somehow it was impossible to translate these words. We also use Polylang pro, so I modified file class-braintree-frontend-scripts.php and added “pll” to: $data [‘order_button_text’] = pll__( ‘Checkout With PayPal’, ‘braintree-payments’ ); . We used this instructions from Polylang : https://polylang.pro/doc/function-reference/#pll_register_string.
    Now we have translated strings and it works OK.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @ugenijus,

    I would recommend that you not modify the plugin’s code directly as any upgrade to a new version will overwrite your changes.

    Instead you should use the filter provided by the plugin that allows you to modify the variables before they are output to the checkout page.

    Filter: bfwc_localized_script_vars
    Variables: $data, $handle

    Kind Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Checkout with paypal button translation’ is closed to new replies.