How can I change the 'Buy it now' button text for different languages?

How can I change the 'Buy it now' button text for different languages?

Andrey_tea
Visitor
3 0 0

How can I localize "Buy it now" button in dawn theme?

I want it to show different texts for two versions of my shop: Russian and Hebrew.

 

And one more question: how to apply RTL direction of the text? In order to change direction in only one of version - in Hevrew version.

Replies 8 (8)

Transcy
Shopify Partner
285 19 85

Hello @Andrey_tea ,

We are Transcy - a powerful translator and currency converter.

 

To localize the "Buy it now" button in different languages, it may need some technical skills. However, you can consider to learn about us here . With Transcy, you can skip the complex steps and localize your button in just few simple steps. 

 

And for the question how to apply RTL direction of the text, you can try following these steps:

1. Go to Online store -> Themes -> Click Action -> Choose Edit code

2. Navigate the "assets" folder and open the "theme.scss.liquid" file.

3. Add this code at the bottom of the file

[data-direction="rtl"] {
  direction: rtl;
}

4. Save changes and go to the "theme.scss.liquid" file.

5. Go to the "locales" folder and open the language file for the Hebrew language ("he.json").

6. Find the key for the "Buy it now" button text and add a new key-value pair for the direction of the text. Example: 

"add_to_cart": {
  "text": "לקנייה עכשיו",
  "direction": "rtl"
}

7. Save and go to the "sections" folder and open the "product-template.liquid" file.

8. Find the code for the "Buy it now" button and add the "data-direction" attribute to set the direction of the text. For example:

<button type="submit" name="add" id="add-to-cart" class="btn btn--secondary-accent{% if section.settings.enable_payment_button %} btn--payment{% endif %}" data-direction="{{ 'add_to_cart.direction' | t }}">
   {% include 'icon-bag' %}
   {{ 'add_to_cart.text' | t }}
</button>

9. Save and test.

 

Hope these informations will help you out. Don't be hesitate to contact us if you need any further support. Please hit the Like Button or mark this as Accepted Solution to let us know is this is useful, it encourage us a lot.

 

Best regards,

Transcy by OneCommerce.

Transcy - The #1 Translation and Currency Converter
- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Blog
Andrey_tea
Visitor
3 0 0

I couldn't find the way how to localize buy in now button using your App

soleseriouss
Trailblazer
316 10 38

Have you tried contacting Shopify support?

Online Sneaker Store - Soleseriouss

richbrown_staff
Shopify Staff
651 95 160

Hey @Andrey_tea , 'Buy it now' cannot be edited unfortunately, however it should be translated by Shopify for Hebrew and Russian. Are you still having this problem?

 

RTL is not currently natively supported by Dawn, but it is under consideration.

To learn more visit the Shopify Help Center or the Community Blog.

l000p
Shopify Partner
5 2 1

I am facing the same issue with Bulgarian. Can we file an issue for a translation of the "Buy it now" button? How to do so?
Currently, I am using this workaround.
https://gist.github.com/vvkh/d8ca7657fa85ffd120c3fc5329d8818c 

shopifyavi
Shopify Staff
40 6 19

I'm going to look into this and get back to you on that

To learn more visit the Shopify Help Center or the Community Blog.

Datposters
Visitor
1 0 0

Could you translate into Ukrainian 

shopifyavi
Shopify Staff
40 6 19

I will be looking into it!

To learn more visit the Shopify Help Center or the Community Blog.