Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Support request] Stripe Checkout box translation

Simple Membership Plugin › Forums › Simple Membership Plugin › Stripe Checkout box translation

Tagged: stripe invoice frequency translation, stripe translation

  • This topic has 15 replies, 4 voices, and was last updated 6 years, 9 months ago by aitor.
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • Author
    Posts
  • April 11, 2019 at 4:48 am #17863
    kotoko
    Participant

    Hello. Thank you for wonderful plugin.
    I am testing Stripe Buy Now button in test mode.
    Buy Now button itself is translated in Japanese but popup checkout box is not translated.
    I would like to translate “Pay $5” into Japanese.
    Hopefully automatically be translated according to customer’s language.
    Could you tell me to where to refer or any ideas?

    What I tried:
    -read this doc; Translate Stripe checkout box | WordPress.org
    -deactivated all Stripe related plugins.

    Sincerely.

    April 13, 2019 at 6:47 am #17881
    mbrsolution
    Moderator

    Hi, your best option is to install Loco Translate plugin. That will allow you to translate that string in Japanese. Let me know if this helps you.

    Kind regards

    April 14, 2019 at 3:01 am #17884
    kotoko
    Participant

    Thank you for the reply and your help.

    I installed Loco Translate Plugin, clicked Plugin>SimpleWordpressMembership>日本語(Japanese)>Edit, and searched “Pay” text.
    But I could not find it.

    Best regards

    April 14, 2019 at 3:44 am #17886
    mbrsolution
    Moderator

    Hi, sorry but my previous suggestion above in regards to installing the Loco Translate plugin was incorrect.

    Please read the following documentation. Let me know if this helps you.

    Kind regards

    April 14, 2019 at 7:27 am #17888
    kotoko
    Participant

    Hi, thank you for the reply.
    (Loco Translation Plugin helped me a lot to translate other parts. Thank you for your help!)

    I created the Stripe Buy now Button following the documentation, and I checked Payment Currency was selected Japanese Yen.

    (The setting works for transaction of Japanese Yen.)

    Best regards.

    April 14, 2019 at 7:59 am #17890
    mbrsolution
    Moderator

    Hi, I am glad to know that your issue is resolved 🙂

    I am marking this thread as resolved.

    Enjoy the plugin.

    April 14, 2019 at 8:44 am #17891
    kotoko
    Participant

    Hi, thank you for the reply.

    I would like to tell you that my issue is not solved yet.
    (In the last post, I tried to explain the situation.)

    Popup Stripe checkout box is not translated.

    Best regards.

    April 14, 2019 at 9:14 am #17893
    kotoko
    Participant

    P.S. Is popup Stripe checkout box with Simple Membership supposed to be translated according to location like Paypal?

    April 14, 2019 at 10:02 am #17894
    mbrsolution
    Moderator

    Hi,

    Popup Stripe checkout box is not translated.

    I think the popup window is controlled by Stripe.

    Regards

    April 14, 2019 at 12:05 pm #17899
    kotoko
    Participant

    Hi, thank you for the reply.

    I am a little bit confused.

    When I tried this code on my website as stripe suggested on this page, popup Stripe checkout was translated.

    <form action="your-server-side-code" method="POST"><script
        src="https://checkout.stripe.com/checkout.js" class="stripe-button"
        data-key="●●"
        data-amount="999"
        data-name="▲▲"
        data-description="Widget"
        data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
        data-locale="auto"
        data-currency="jpy">
      </script></form>

    I wonder what the difference is.
    Okay, I will ask Stripe.

    Thank you for your help.

    Best regards.

    April 15, 2019 at 5:38 am #17902
    kotoko
    Participant

    Hi, I found the code which popup Stripe checkout box was translated successfully!

    Here is the original code in plugins/simple-membership/views/payments/payment-gateway/stripe_button_shortcode_view.php.
    Could you read the key points in this order?: ※1→※2→※3

    	/* === Stripe Buy Now Button Form === */
    	$output = '';
    	$output .= '<div class="swpm-button-wrapper swpm-stripe-buy-now-wrapper">';
    	$output .= "<form action='" . $notify_url . "' METHOD='POST'> ";
    	$output .= "<div style='display: none !important'>";
    
    	$output .= "<script src='https://checkout.stripe.com/checkout.js' class='stripe-button'
    		data-key='" . $publishable_key . "'
    
    ※2 This line was removed because it affected data-locale='auto'. By removing this line, "pay" was translated.
    		data-panel-label='Pay'
    
    		data-amount='{$price_in_cents}'
    		data-name='{$item_name}'";
    
    ※1 I found that web browser didn't read these three lines.
    When these three were put into above $output, web browser read these, and Stripe checkout box was translated successfully except currency and "Pay" translation.
    	$output .= "data-description='{$payment_amount} {$payment_currency}'";
    	$output .= "data-locale='auto'";
    	$output .= "data-label='{$button_text}'"; //Stripe doesn't currenty support button image for their standard checkout.
    
    ※3 This line includes two key points for translating currency symbol. 
    First, this line needed to be put just after data-locale line. Order was important. 
    Second, I think {$payment_currency} output uppercase letters. However data-currency needed lowercase letters. 
    Two key points were needed at the same time in order to translate currency symbol.
    (I didn't know how to change uppercase letters into lowercase letters here, so that I wrote 'jpy' directly at the moment. Could you help me?)
    	$output .= "data-currency='{$payment_currency}'";
    
    		if (!empty($item_logo)) {//Show item logo/thumbnail in the stripe payment window
    			$output .= "data-image='{$item_logo}'";
    		}
    		if (!empty($billing_address)) {//Show billing address in the stipe payment window
    			$output .= "data-billing-address='true'";
    		}
    	$output .= apply_filters('swpm_stripe_additional_checkout_data_parameters', ''); //Filter to allow the addition of extra data parameters for stripe checkout.
    	$output .= "></script>";
    	$output .= '</div>';

    Here is the code Stripe checkout box translated successfully. Transaction worked successfully as well.

    	/* === Stripe Buy Now Button Form === */
    	$output = '';
    	$output .= '<div class="swpm-button-wrapper swpm-stripe-buy-now-wrapper">';
    	$output .= "<form action='" . $notify_url . "' METHOD='POST'> ";
    	$output .= "<div style='display: none !important'>";
    
    	$output .= "<script src='https://checkout.stripe.com/checkout.js' class='stripe-button'
    		data-key='" . $publishable_key . "'
    
    		data-amount='{$price_in_cents}'
    		data-name='{$item_name}'
    		data-description='{$payment_amount} {$payment_currency}'
    		data-locale='auto'
    		data-currency='jpy'
    		data-label='{$button_text}'//Stripe doesn't currenty support button image for their standard checkout.
    			if (!empty($item_logo)) {//Show item logo/thumbnail in the stripe payment window
    				data-image='{$item_logo}'
    			}
    			if (!empty($billing_address)) {//Show billing address in the stipe payment window
    				data-billing-address='true'
    			}
    	";
    
    	$output .= apply_filters('swpm_stripe_additional_checkout_data_parameters', ''); //Filter to allow the addition of extra data parameters for stripe checkout.
    	$output .= "></script>";
    	$output .= '</div>';

    In this code, I wrote data-currency=’jpy’ directly.
    If the issue of this part can be solved and you think this code is okay for everyone, could you consider of including this fix into next plugin update?

    As always, thank you for wonderful plugin (and documentation which is very easy to understand) and your supports.

    Best regards.

    August 11, 2019 at 2:52 pm #18722
    Marta
    Participant

    Hi Mbrsolution,

    I have tried Kotoko’s code because I want my Stripe Checkout to be in Spanish, and I have noticed that it only translates partially.

    Kotoko’s code has worked, but, since your line

    «««««« $output .= “data-description='{$description}'”; »»»»»»

    has been replaced by:

    «««««« data-description='{$payment_amount} {$payment_currency}’ »»»»»»

    the result is that I get, for instance, “19 EUR”, instead of “19 EUR / month”

    Your line, actually, gives me “19 EUR / month”.

    But the problem is that “month” is a word in English for the invoice frequency of this particular suscription. I need that word to be in Spanish!

    I haved tried to translate that word, “month” with Loco Translate, but it’s not possible.

    So, my questions are:

    – Is this Stripe’s fault and we can’t do anything about it?
    – Or is this something you could fix?

    Thanks in advance, and congratulations for a great plugin.

    Marta.

    August 11, 2019 at 5:46 pm #18723
    Marta
    Participant

    By the way… here’s a link from Stripe about this subject, in case it’s useful:

    https://stripe.com/es/blog/checkout-in-more-languages

    August 11, 2019 at 9:30 pm #18724
    mbrsolution
    Moderator

    Thank you Marta for reaching out to us. I have submitted a message to the developers to investigate further this issue.

    Kind regards

    August 23, 2019 at 9:01 pm #18802
    Marta
    Participant

    Any update on this?

    Thanks!

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy