This thread is resolved. Here is a description of the problem and solution.
Problem:
The client needed to adapt affiliate widget code for language support on their site, specifically to translate the 'data-gyg-locale-code' attribute in the widget code.
Solution:
We recommended using a custom XML configuration in WPML to make the widget code translatable. Here are the steps we suggested:
1. Navigate to WPML >> Settings >> Custom XML >> Configuration section: https://purple-drumbox.sandbox.otgs.work/wp-admin/admin.php?page=tm%2Fmenu%2Fsettings&sm=custom-xml-config
2. Add the following XML code:
<wpml-config><gutenberg-blocks><gutenberg-block type="html" translate="1"><xpath>//div[@class="data-gyg-locale-code"]</xpath></gutenberg-block></gutenberg-blocks></wpml-config>
3. Save the changes.
4. Make a small edit to the default language page to trigger a reload of the translation.
5. Open the translated page in WPML Advanced Translation Editor, search for the English locale code en-EN, and replace it with the translated locale code.
If this solution does not apply to your case, or if it seems outdated, 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 issues persist, please open a new support ticket at https://wpml.org/forums/forum/english-support/.
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 11 replies, has 0 voices.
Last updated by 1 month, 4 weeks ago.
Assisted by: Noman.