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.
Tagged: Custom Work
This topic contains 5 replies, has 2 voices.
Last updated by Andrey 1 year, 2 months ago.
Assisted by: Andrey.
Author | Posts |
---|---|
October 17, 2023 at 12:29 pm #14594145 | |
Swen Kleibrink |
Tell us what you are trying to do? I added the code e(....) to the code snippet so string translation can find it. This is the code add_action( 'woocommerce_after_add_to_cart_button', 'my_function_sample', 10 ); echo "<button type='button' onclick=\"location.href='hidden link'\" class='single_add_to_cart_button button alt wdm_enquiry' style='background:rgb(0, 171, 0) none repeat scroll 0% 0%';>Back to Shop</button>"; } Is there any documentation that you are following? yes yours Is there a similar example that we can see? What is the link to your site? see above links |
October 17, 2023 at 8:12 pm #14597761 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for contacting WPML support. To translate the strings in the code snippet, you have to localize them. The text must be wrapped in gettext calls. Please follow this article: |
October 17, 2023 at 8:14 pm #14597763 | |
Swen Kleibrink |
I see you did not read my support what a waste of time !!!!!! |
October 17, 2023 at 8:23 pm #14597795 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
I have read it carefully. As I mentioned before, you did not localize the string in the snippet you shared. Please share an updated snippet with me if you did as you said. I suggest the following: – Localize the string in the snippet |
October 20, 2023 at 7:08 am #14620705 | |
Swen Kleibrink |
according to you article it is supposed to be formated like this and it is found in string translation and translated but on front end not |
October 20, 2023 at 7:21 am #14620755 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for the update. Please try to remove the current string from WPML → String Translation, register and translate it again. Have you tried to add your snippet to the functions.php of your current theme? To help you faster, I've enabled debug information for this support ticket. Please see this link for how to get this information from your site and give it to us: http://wpml.org/faq/provide-debug-information-faster-support/ |