[Resolved] Related Sessions not translated to arabic
This thread is resolved. Here is a description of the problem and solution.
Problem: The client needed to translate the term 'RELATED SESSIONS' which was manually changed from 'related products' in a PHP file on their server, and was not appearing in WPML's string translation. Solution: We advised the client to ensure that the string 'Your Custom Title' is wrapped with a WordPress translation function to make it translatable by WPML. Here's a step-by-step guide: 1. Modify the PHP code in functions.php to include a translation function:
2. Replace 'your-text-domain' with the theme’s text domain. 3. Navigate to WPML → Theme and plugins localization and scan the theme so WPML can detect the new string. 4. Go to WPML → String Translation, search for 'Your Custom Title', add the Arabic translation, and save.
If this solution does not resolve your issue or seems outdated, we recommend opening a new support ticket. We also advise 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. For further assistance, please visit our support forum 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.
Related Sessions not translated to arabic here: hidden link because it was changed manually from CPANEL from server side and its not appearing in WPML string translation and in text admin area. where can i find it please urgently?
I checked the page and I can see the “Related Sessions” section displaying on both Arabic and English versions.
Could you please clarify what exactly is not translated or not showing as expected? If possible, a screenshot or a specific example would help.
Also, regarding your note about changes made manually via cPanel/server side, could you explain what was modified and how? This is important, as such changes can bypass WPML and therefore not appear in String Translation or admin texts.
Could you please confirm if those words (“RELATED SESSIONS”) are added manually somewhere (for example inside the page, builder, theme options or template)?
If not, then they are most likely coming from your theme or a plugin. In that case, you can translate them by doing the following:
- Go to WPML → String Translation
- Search for “RELATED SESSIONS”
- Add the translation for Arabic and save
If you are not able to find the string, you may first need to scan your theme/plugins:
- Go to WPML → Theme and plugins localization
- Scan the active theme and related plugins
- Then check again in String Translation
I did all above steps already, but couldn't find the sentence. This is basically from the theme, and instead of related products, I changed it manually from server to related sessions, its alike a PHP file inside my server, so it's from the theme, but WPML cant translate that?
// Rename Related Products title in WooCommerce
add_filter( 'woocommerce_product_related_products_heading', 'custom_related_products_heading' );
function custom_related_products_heading( $heading ) {
return 'Your Custom Title'; // Change 'Your Custom Title' to what you want
}
In the functions.php file on the server here: hidden link, so I need to translate that to Arabic in WPML. Is that possible?
In your case, the text “Your Custom Title” is hardcoded in PHP via functions.php. Because of that, WPML will not automatically detect it for translation unless it is registered properly.
To make this translatable in WPML, you need to wrap the string with a WordPress translation function.
Replace 'your-text-domain' with your theme’s text domain for example.
After that:
- Go to WPML → Theme and plugins localization
- Scan your theme (so WPML detects the new string)
- Go to WPML → String Translation
- Search for “Your Custom Title”
- Add the Arabic translation and save
I still cant find the English words in WPML here: hidden link There is still words in English that should be in arabic and I can't translate them unfortunately.
YES AMAZING! all good for the related sessions! Finally, it's showing now: hidden link after enabling string translation settings for JS and PHP files as well in WPML settings.
SORRY SORY MY BAD! Forgot to mention that this is the arabic shop page: hidden link and it's the translation of the English shop page: hidden link but I had to change the page title as per the project needs, and I want to translate all of that to arabic.
New threads created by Dražen and linked to this one are listed below: