This thread is resolved. Here is a description of the problem and solution.
Problem:
The client had custom buttons for WooCommerce's Minicart widget and was unable to find an option to translate the button's text using WPML string translations. The code snippet provided was included in the child theme's functions.php file and worked for the primary language, but the translations were not appearing in WPML.
Solution:
If you're experiencing issues with translating custom button texts in WooCommerce's Minicart widget, first ensure that your strings are properly wrapped for translation. The client's buttons were already using the
esc_html__()
function, which is correct. We recommend scanning your child theme again in WPML to find the strings. Here's a step-by-step guide:
1. Go to WPML > Theme and plugins localization.
2. Make sure that the 'Translate by WPML.' option is selected.
3. Click on the 'Scan the theme for strings' button.
4. Once the scan is complete, go to WPML > String Translation. You should now see the strings and be able to translate them.
Additionally, review our documentation on enabling text translation for themes not compatible with WPML: https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/
Please note that the solution provided might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, 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 2 replies, has 2 voices.
Last updated by 11 months, 4 weeks ago.
Assisted by: Bobby.