Problem with theme translation

Hi there,

Iā€™m trying to translate this page with pro:

https://tablebudapest.com/kosar/

I have been able to do most via editing the .po and .mo files, however, the apply coupon button is a stubborn one.
After some searching, I found that I should create a separate cart.php file (the file which contains this string) in pro-child/woocommerce/cart/cart.php. I edited the file so it displayed the translation, but it does not work on the front-end, any idea why?

Thanks a bunch!

Hi There,

Please setup a child theme first:

After that add the following code under functions.php file locates in your child theme directory:

add_filter( 'gettext', 'x_edit_texts' );
function x_edit_texts($translation){
	$translation = str_ireplace('Apply Coupon', 'Your text', $translation);
	return $translation;
}

Replace Your text with your language.

Hope it helps :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.