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.
No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
This topic contains 3 replies, has 3 voices.
Last updated by pavlinaD 1 year, 7 months ago.
Assisted by: Andreas.
Author | Posts |
---|---|
March 23, 2023 at 11:39 am #13314675 | |
pavlinaD |
Hi there, Hope you're doing well! Tell us what you are trying to do? These are the strings in question: hidden link - here is where they appear on the front-end: hidden link. We tried changing the code to: hidden link and this is what this resulted in on the front-end: hidden link. Still went through scanning the child theme for new strings, but nothing changed. We checked that "themedomain" matches our child theme domain as instructed in your tutorial: hidden link. Is there any documentation that you are following? What is the link to your site? Could you please direct us how to change the code perhaps so that it works in our case? 🙂 Thanks in advance! |
March 23, 2023 at 12:12 pm #13314981 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for contacting us. All looks good, except for one thing. You are adding PHP code inside HTML as I can see, in that case, you need to wrap that code inside PHP tags. For example: <h2><?php _e( 'Thank you!', 'my-plugin-domain' ); ?></h2> I suggest checking the next documentation from our side which few more examples of how to use it properly. After that, just regularly scan theme files nad you should be able to translate it via WPML String Translation. Let us know how it goes. Kind regards, |
March 23, 2023 at 1:01 pm #13315397 | |
Andreas |
Hello there Thank you for contacting us. I am happy to help you. First of all custom code is our of the scope of this support , however I will help you with a few tips. When you make changes in code and you need then to rescan the files, in your case Astra theme, you need to rescan the files in order to String Translation read the new changes: Now based on your code, I can see that they are some errors using the gettext function and this is the reason you can see the wrong data in the frontend. The alias of gettext php function is _() , so since you see that _() in frontend you are using the wrongly gettext function. Please read our developers documentation for more details and examples I hope this helps. Please let us know how it goes or if you need any further assistance. I'll gladly help you. 🙂 Regards, |
March 23, 2023 at 3:33 pm #13316799 | |
pavlinaD |
We managed to resolve the issue using the snippet, provided by Drazen. Thanks heaps, guys! |