Skip Navigation

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

Problem:
The client's website default language is set to traditional Chinese, but the "Add to cart" button on a single product page is displayed in English. The client attempted to use the string translation function to translate the button text, but it was not successful.
Solution:
We recommended the following steps:
1. Increase the WP Memory Limit to at least 128MB, as per WPML's minimum requirements, by adding the following code to the top of the wp-config.php file:

/* WP Memory Limit */<br />define('WP_MEMORY_LIMIT', '256M');

2. Navigate to WPML >> Theme and plugins localization page, select the current parent/child theme, and click the “Scan selected themes for strings” button.
3. On the same page, select WooCommerce and click the “Scan selected plugins for strings” button.
4. Go to WPML >> String Translation page, search for the required string, and add the translation.
5. If the issue persists, follow these additional steps:
5.1. Enable the ‘Look for strings while pages are rendered’ option in the Auto register strings for translation section on the WPML >> String Translation page.
5.2. Visit the page on the front end where the string appears.
5.3. Return to the WPML >> String Translation page and search for that string again.
5.4. Translate the string.
5.5. After translating, disable the auto-registration option.

If the solution provided here is not relevant due to being outdated or not applicable to your case, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should the issue persist, please open a new support ticket with us.

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 topic contains 1 reply, has 2 voices.

Last updated by Noman 1 year ago.

Assisted by: Noman.

Author Posts
April 4, 2024 at 11:49 am #15482749

bizprocessE

Currently my website default language is set to traditional Chinese, But I'm not sure why the "Add to cart" button in a single product page show in English. I tried to use the string transaction function to translate the button text but it was not working. I need help!

Screenshot 2024-04-04 at 7.43.46 PM.png
April 4, 2024 at 12:06 pm #15482882

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. Could you please follow the below steps and let me know how it goes:

1. The current WP Memory Limit on your site is 40MB. The WP memory limit needs to be increased, it's different from PHP memory. PHP memory is fine but WordPress uses 40MB as default in your site. The minimum requirements for WPML are 128MB: https://wpml.org/home/minimum-requirements/

Please add this to the top of wp-config.php to increase WP memory:

/* WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');

2. Please go to WPML >> Theme and plugins localization page, select the current parent/child theme, and press the “Scan selected themes for strings” button.

3. Please go to WPML >> Theme and plugins localization page, select the WooCommerce and press the “Scan selected plugins for strings” button.

4. Please go to WPML >> String Translation page and search for your required string and add the translation.

5. If the above steps doesn’ help, please try the below procedures:

5.1. Go to the WPML >> String Translation page and in the Auto register strings for translation section, enable the ‘Look for strings while pages are rendered’ option.

5.2. Re-visit the page on the front end where the string appears.

5.3. Re-visit the WPML >> String Translation page and search for that string.

5.4. Translate the string.

5.5. After translating the string, uncheck the auto-registration option.

Please let me know the results,

Thank you

April 10, 2024 at 6:14 am #15502126

bizprocessE

Issue resolved.