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
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.