Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client moved their development site to a new domain and encountered issues with string translations not connecting to the theme folder due to a change in the file structure. The client was unable to add translations or find new or changed PHP strings.

Solution:
We suggested that the issue might have occurred during the migration process and recommended using the Duplicator plugin to ensure a proper migration. This plugin helps with replacing old URLs in the database with new ones during the migration.

If the client had not started translating or was still in the testing phase, we also recommended resetting WPML:

  1. Go to WPML → Support and click the Troubleshooting link.
  2. In the Reset section of the Troubleshooting page, select the 'I am about to reset all translation and language data' checkbox.
  3. Click the 'Reset and deactivate WPML' button.

WPML Reset Documentation
We advised creating a backup before performing the WPML reset as it cannot be undone and all translations sent to remote services will be lost.

If the provided solution is not relevant due to being outdated or not applicable to your case, 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. Should you need further assistance, 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.

Tagged: 

This topic contains 14 replies, has 3 voices.

Last updated by Andrey 1 year, 1 month ago.

Assisted by: Andrey.

Author Posts
April 9, 2024 at 11:27 am #15498828

katharinaA-2

Hello,

I have just moved our dev site from dev.trustandtravel.com to trustandtravel.com/blog, i believe the string translations cannot connect to the theme folder due to the extra folder within the file structure - /blog/wp-content/themes/ttblog-theme rather than /wp-content/themes/ttblog-theme - (which is what it was before).

Perhaps i am wrong, all i know is that i cannot add translations, the search for new or changed php e tags do not show up. and i have tried all of this - https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/ as well as registering the keys again

Can you help?

thanks, Sam

April 9, 2024 at 9:31 pm #15501763

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Sam.

This sounds to me like an issue that took place in the migration process, because, all the old URLs that exist in the database should be properly replated in the migration process with the new domain.

For migrating/duplicating sites, our recommendation is to use the following plugin:
- https://wordpress.org/plugins/duplicator/

Documentation can be found here:
hidden link

Here is a small tutorial on how to use Duplicator:
hidden link

This should perfectly migrate your website maintaining the exact same setup and also taking care of the search and replace process so that the old links will be overwritten with the new URLs of the new domain you are migrating to (in case you are also changing the domain and not only the server).

I hope that you will find this helpful 🙂 I use only Duplicator each time I want to migrate WP websites. They also have a premium version but if you don't have a huge website with a huge database, the free version should work fine.

Please let me know how things go.

Mihai

April 10, 2024 at 8:00 am #15502578

katharinaA-2

Hello,

I dont need a plugin to migrate websites, i am a developer who has done this for many years and migrated many sites.

The site migrated well, my problem is that WPML is not finding the theme folder when searching for strings due to the unusual domain structure of the blog site being with the folder trustandtravel.com/blog instead of just trustandtravel.com.

And im asked how i can get it to re-find the folder with the new domain structure.

Please advise.

thanks, Sam

April 10, 2024 at 9:12 pm #15506535

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Hello Sam,

Thank you for sharing your feedback. I understand that you are a developer, and I suggest testing the method of moving the site as Mihai suggested. Speaking from personal experience, I have moved many sites using the Duplicator plugin and have not encountered any issues after the migration is complete.

You can also try to regenerate .mo files. To do this, you can go to WPML -> Support -> Troubleshooting page and click on the "Show custom MO Files Pre-generation dialog box" button. Then, in the dialog box that appears, click the blue button to regenerate custom MO files.

I hope this helps.

April 11, 2024 at 9:56 am #15508209

katharinaA-2

Hello,

Thanks for your help, i have noticed when searching for strings it IS finding the new ones - IE the number of strings found goes up, however they are not showing in the strings table.

It is still not letting me add translations either - i get translation failed.

Does this give you an indication of what might be going wrong?

Also, i dont not have a regenerate MO files button, I only have a - Show custom MO files Pre-generation dialog box.

Which i clicked and it said: WPML needs to generate .mo files, so i click generate .mo files

But the box on the troubleshooting page doesnt change to re-generate.

Where are these MO files stored on my server?

Is this the issue? The connection between the MO files, my theme and the string translation table?

Is there another cache to flush or something to make it all reconnect?

thanks, Sam

Screenshot 2024-04-11 at 10-46-25 Troubleshooting ‹ Katharina's Italy — WordPress.png
Screenshot 2024-04-11 at 10-47-36 Troubleshooting ‹ Katharina's Italy — WordPress.png
Screenshot 2024-04-11 at 10-55-58 String Translation ‹ Katharina's Italy — WordPress.png
April 11, 2024 at 10:49 am #15508520

katharinaA-2

this is in the error log - does this mean anything?

Date Event Description WPML Job ID ATE Job ID Extra data
2024/04/09 11:05:13 AM ATE Server Communication Unable to authenticate 0 0 {"url":"https:\/\/ate.wpml.org\/api\/wpml\/languages\/check_pairs","requestArgs":{"method":"POST","body":[{"source_language":"en","target_languages":["fr","de"]}]},"status":"auth_error"}

April 11, 2024 at 2:14 pm #15509763

katharinaA-2

I have copied the site back onto its original domain and i am having the same issue - hidden link. I dont believe its a problem with the domain or transfer.
When scanning the theme for strings it just crashes the page - IE loads forever, isnt finding the new strings.
Can you advise?

thanks, Sam

April 11, 2024 at 3:32 pm #15510152

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback, Sam.


It is still not letting me add translations either - i get translation failed.

Could you show me the screenshot and elaborate on the original issue you are facing?

The .mo files are located in the wp-content/languages folder. I cannot yet say for sure why you are having the problem you are reporting.


When scanning the theme for strings it just crashes the page - IE loads forever, isnt finding the new strings.

Please activate the debug.log and see what is there when you scan. You can do this by adding a few lines to the site’s wp-config.php file.

To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

In order to enable the error logging to a file on the server you need to add yet one more similar line:

define( 'WP_DEBUG_LOG', true );

In this case, the errors will be saved to a debug.log log file inside the /wp-content/directory.

https://wpml.org/documentation/support/debugging-wpml/

Let me know how it goes.

April 11, 2024 at 4:30 pm #15510480

katharinaA-2

Hiya,

Right, original issue:

I add a new string - <?php _e('test', 'ttblog-theme'); ?> into say the header template.
I upload it, go to Themes & Localisation > check my theme, hit scan.
It just loads for ever OR finds the new string but does not show it in the table – see screen shot.

I have turned debug on, and on the Translation Management page i have this error:

Fatal error: Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;s:4:"9919";i:1;s:5:"post%";} in /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php:193 Stack trace: #0 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array) #1 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array) #2 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-records.php(139): WPML_TM_ICL_Translations->__constru in /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php on line 193

There has been a critical error on this website. Please check your site admin email inbox for instructions.

Looks like its coming from within the plugin...? Is this the problem im having? How do i fix it?

thanks, Sam

Screenshot 2024-04-11 at 17-15-13 Theme and plugins localization ‹ Katharina's Italy — WordPress.png
April 11, 2024 at 4:37 pm #15510507

katharinaA-2

getting the same error in the debug log

[11-Apr-2024 16:34:44 UTC] PHP Fatal error: Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;s:4:"9919";i:1;s:5:"post%";} in /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-records.php(139): WPML_TM_ICL_Translations->__constru in /var/www/vhosts/h11.web17.wh20.easyname.systems/htdocs/website/blog/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php on line 193

April 11, 2024 at 6:51 pm #15510824

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Yes, this fatal error prevents from finishing the scanning. Could you explain how you moved your website when the problem first occurred?

I feel that not the entire website has been moved, which could explain the missing entries in the database.

If no translating has been done yet, and this is in the testing stage, I suggest resetting WPML and setting it up again.

1. Go to WPML → Support and click the Troubleshooting link.

2. In the Reset section of the Troubleshooting page, select the I am about to reset all translation and language data checkbox. Then, click the Reset and deactivate WPML button.

https://wpml.org/documentation/getting-started-guide/language-setup/deleting-languages-and-plugin-data-by-doing-a-wpml-reset-on-your-site/


The WPML reset cannot be undone. All translations you have sent to remote translation services will be lost.

I recommend that you create a backup of your site before resetting WPML.

April 11, 2024 at 7:04 pm #15510832

katharinaA-2

Hiya,

The usual way - i moved the files to the new folder, changed the url in the database (site and home), updated permalinks.

Translating has be done, so i would prefer not to loose all the data.

However if this is the only option, will it only loose the strings? Or all the translated pages?
Is there a way to re-upload/re-update the plugin without loosing data? Or fix those files with WPML without loosing data?

thanks, Sam

April 11, 2024 at 8:29 pm #15510934

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

If the translations have already been completed, resetting WPML is not a viable solution.

I need to request temporary access (wp-admin and FTP) to your site – preferably to a test site where the problem has been replicated if possible – in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Please include steps to replicate the issue, except if there is something else besides theme scanning.

April 12, 2024 at 11:06 am #15512590

katharinaA-2

Thank you for your help, but i have resolved the issue by completely restoring the original database to before the transfer and re-pointed it to the new site - would have been a quick fix if suggested earlier, hope this helps someone else in the future!

April 12, 2024 at 12:31 pm #15512938

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I am glad to hear that it works now. I hope you have a lovely weekend ahead!