This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to find new strings added to their theme for translation in WPML after updating the theme. The strings were not showing up in the WPML string translation scan. Solution: We recommended the following steps: 1. Ensure that the strings in the theme's PHP files are correctly formatted without any preceding backslashes in the function calls. 2. Modify the PHP file where the strings are added, specifically removing incorrect syntax or characters that might prevent WPML from recognizing these strings. 3. Rescan the theme for strings via WPML > Theme and plugins localization > Strings in the themes > Scan selected themes for strings. 4. Once the strings appear in the WPML string translation list, proceed with the translation.
If this solution does not resolve your issue, or if it seems outdated, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket.
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.
I'm trying to translate new strings that have been added to the theme, but they are not showing up when I run:
Theme and plugins localization > Strings in the themes >
Scan selected themes for strings
Most of the strings are found, however I recently updated the theme and added the following new ones:
\__('Key info', 'granola')
\__('Eligibility Criteria', 'granola')
\__('Frequently Asked Questions', 'granola')
Thank you for contacting us. Could you please inform me where I can find the following items on your website? Kindly provide the URL of the page where I can view them:
- Key information
- Eligibility criteria
- Frequently asked questions
Additionally, please specify where you inserted these items into your theme files.
//List all fields that we want to show in sidebar
$fundlabels = ['value_of_grant', 'applications_open_date', 'applications_close_date'];
$sidebar_content = "";
1. I've installed the file manager plugin as SFTP isn't functioning for me.
2. I've made adjustments to the single-fund.php file. Specifically, on line 35, I've removed the backslash from the code 'heading' => __('Key info', 'granola').
3. I've conducted a scan of the strings, and the amended phrase appears here: hidden link
4. Subsequently, I've translated it, and it appears to be functioning correctly here: hidden link.
That is very strange as strings seem to have been picked up from other files with the prefix \__
However the translations are now working - many thanks!
Louise Fox confirmed that the issue was resolved on 2024-05-21 11:18:58.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.