This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was unable to translate strings within custom code snippets using WPML, despite using the text domain method.
Solution:
1. We advised the client to ensure that the code is written with internationalization in mind, specifically that the echo statements contain the correct format. For more details, see https://developer.wordpress.org/themes/functionality/internationalization/#add-text-domain-to-strings.
2. We suggested correcting potential syntax errors in the code, such as missing curly braces and ensuring the correct usage of single quotes in the text domain.
3. We recommended rescanning the theme or plugin for strings after making these corrections. For guidance on this process, visit https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#scan-the-theme-or-plugin.
4. Alternatively, if using another plugin to add code, the client might need to add the code directly to the theme's functions.php file or follow specific steps for that plugin as discussed in a related support ticket: https://wpml.org/forums/topic/code-snippet-text/.
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. Should you need further assistance, please open a new support ticket at WPML support forum.
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.
Our next available supporter will start replying to tickets in about 7.93 hours from now. Thank you for your understanding.
This topic contains 5 replies, has 2 voices.
Last updated by 1 month, 2 weeks ago.
Assisted by: Mihai Apetrei.