This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:
I cannot find a way to translate "cart" in my header.
Solution:
The file I edited is wp-content/themes/halena/template/theme-functions.php and just change this part from line 973:

esc_html( 'Cart', 'halena' );

to this:

esc_html__( 'Cart', 'halena' );

100% of people find this useful.

This topic contains 12 replies, has 2 voices.

Last updated by Radu 1 month, 1 week ago.

Assigned support staff: Radu.

Author Posts
April 21, 2019 at 8:47 am #3651909

Baptiste

Hi,
my website is set in "French". Most of WooCommerce strings were automatically translated into French.
However, some strings still show in English in the "Shopping Cart" page, and I'm not able to translate them into French.
There are only a few things I need to translate :
• the "cart" link in my header
• "Product" & "Price" column titles on my shopping cart page

I can't find where nor how to translate them. I guess it's not very hard but I would gladly appreciate if you could help me.

Thank you in advance!

April 22, 2019 at 1:21 pm #3655931

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

Have you tried to translate these strings by going to Dashboard → WPML → String Translation? You should find them right on that section and have no problem translating everything. Can you give this a try and tell me how it goes, please?

Thanks,
Radu

April 24, 2019 at 5:27 pm #3675573

Baptiste

Sorry for not replying earlier.
"String Translation" was where I tried to translate them.
I must have missed some earlier because I was able to translate "Product" & "Price" a few minutes ago (or maybe my theme was updated).

However, I still cannot find a way to translate "cart" in my header.

I've checked that every string had the right translation or provided a custom translation where needed. Still, this word remains in english.

Is there any solution to this?

April 25, 2019 at 8:28 am #3680083

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

Is there any chance that you could give me access to the dashboard area so I can have a closer look at the button from the top of the page and see if I can find how it can be translated. I set the next reply to be private so just and I can see the credentials.

Thanks,
Radu

May 3, 2019 at 8:33 am #3732233

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

I just tried to access the dashboard area but it seems that my IP was locked out. Can you check this out and add my IP (137.74.120.3) as an exception so I can see why's the cart string not translated, please?

Thanks,
Radu

May 3, 2019 at 9:42 am #3732669

Baptiste

Hi Radu, I just did 🙂 thank you

May 3, 2019 at 1:42 pm #3734887

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

Can you change the IP, please? It seems that the last part was wrong. This is my IP: 137.74.120.37. Please give a message back once you made the change.

Thanks,
Radu

May 3, 2019 at 3:33 pm #3736109

Baptiste

Done 🙂

May 6, 2019 at 10:31 am #3747051

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

Thank you for giving me access to the website. I checked the cart button from the top of the page and it seems that the element is created a bit different, through AJAX. I'm gonna investigate this a bit further and come back when I have some updates about it.

Thanks,
Radu

May 9, 2019 at 7:46 am #3773833

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

I checked this out a bit more but it seems that I need some help from my colleagues to see what we can do to fix this problem. They will investigate things a bit further and, also, contact the theme authors if this is a problem from their side. We'll work together to get things fixed and I'll come back to you as soon as I have any news about this.

Thanks,
Radu

May 13, 2019 at 9:36 pm #3801745

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

My colleagues checked the code and it seems that there's a little change that needed to be done. I did that and now you can see that the cart text is different in English - hidden link, and French - hidden link. We'll contact the theme authors too in order to make sure that they include this fix in the next version.

Can you have a look and tell me if it works fine for you too, please?

Thanks,
Radu

May 14, 2019 at 9:43 am #3805357

Baptiste

Hi Radu, thank you so much for fixing this!
Could you please let me know which file(s) you edited so that I can back them up?
Also, am I now able to translate this string into additional languages by myself?

May 14, 2019 at 11:00 am #3806161

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Baptiste,

The file I edited is wp-content/themes/halena/template/theme-functions.php and just change this part from line 973:

esc_html( 'Cart', 'halena' );

to this:

esc_html__( 'Cart', 'halena' );

Yes, you can now translate this string just as any other string.

Regards,
Radu