Hello. I have used WPML to translate my site into French and Chinese. At the bottom of one of my English pages (hidden link) is a few paragraphs of text. I would like to ensure the text is translated on the French and Chinese pages. What is the best way to do this?
The text in-question has been added to the page via code in the PHP template in-question (see attached screenshot--full pastebin of code here: https://pastebin.com/6a4iri7Q). Would it be best to wrap the code in a _() function, then translate it via WPML-->String Translation? Or should I not use WPML for this, and simply add the translations to the PHP template (and ensure they are displayed when the proper page loads)?
To add translatable strings, you can use the WordPress functions like __() or _e(). Eg:
<?php echo __( 'Your String', 'your-context'); ?>
or:
<?php _e( 'Your String', 'your-context'); ?>
Then, click on WPML > Theme and Plugins Translations. Look for 'Strings in the theme' and click on the 'Scan the theme for strings' button.
Again in WPML > String Translation, you can translate the strings.
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
You only need to replace "Your String". The "Your-Context" is the context of your theme. For you find your context, it is usually the functions.php file. For example: