I see that the original text is wrapped in gettext calls and has a textdomain argument, so it's supposed to be translatable.
Please try the following steps:
- Go to WPML > Theme and plugins localization
- Select the theme/plugin where the string is coming from
- Scan it for strings
- Go to WPML > String Translation
- Search for the string and translate it
Hello Mohamed and thanks for getting back to me. The text is in the parent theme, but I could not find it there after scanning the strings in the theme. Is there any way I can simply add code to the php file?
I used to use this code:
<?php _e ('English'?>
<?php _de ('German'?>
Please note that debugging the custom code is out of the scope of our support, but I will try to point you in the right direction.
In order to output different code based on the language, using the "wpml_current_language" hook might help. Please check the following links for more details:
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if($my_current_lang=='en'){
// Add the code outputs the English text
} else {
// Add the code outputs the German text
}
I would also suggest trying the following steps to translate the text with String Translation:
- Go to WPML String Translation
- Scroll down to the "Auto register strings for translation" section and enable that option
- Visit the page where the string is added on the front end
- Go back to String translation and disable the auto register option
- Search again for the string and translate it