This thread is resolved. Here is a description of the problem and solution.
Problem: The client experiences a critical error when changing the language on their website from English to German after updating to PHP version 8.0 or higher. The error does not occur when using PHP 7.x. Solution: If you're experiencing this issue, we recommend you try the following steps: 1. Navigate to WPML >> String Translation. 2. Search for the "All %s" string. 3. Select the WooCommerce domain and enable the "Exact match" option. 4. Update the German translation from:
Alle %
To:
Alle %s
This should resolve the issue.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend 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. If the problem persists, please open a new support ticket 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.
Background of the issue:
I am trying to update my PHP version to 8.0 or higher, as recommended by WordPress, but encounter issues when changing the language on my website from English to German.
Symptoms:
A critical error occurs when I change the language on my website from English to German after updating PHP to version 8.0 or higher. The error disappears when reverting to PHP 7.x.
Questions:
Why does a critical error occur when changing the language after updating PHP to 8.x?
How can I resolve the critical error related to PHP version changes?
To further debug this issue, please provide FTP Login info to your site, so that I can look into your setup and debug the issue.
Your next answer will be private, meaning only you and I can access it.
=== Please backup your database and website ===
✙ I would need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is essential.
Since you are not responding within a reasonable timeframe, I have reverted the PHP version back to 7.4. An error on this live e-commerce website is unacceptable. If at any point you need PHP 8.2 again for your analysis, please let me know. In that case, we will need to coordinate the timing so that the switch is only temporary, as it causes an error on the live site.
To further debug this issue without affecting your live site, I have set up a fresh WP site on a test server(cloudways) with PHP 8.2. Please migrate your site to our test server and let me know once the migration process completes.
I shared the migration details in my previous private reply.
Thanks for migrating the site. I followed the below steps on test site:
1. Access the wp-content/languages/wpml directory using FTP.
2. Deleted the damaged “woocommerce-de_DE.mo” file and the issue is gone as you can see here: hidden link
Could you please take a backup of your site and try to follow the same steps on your site and see if this resolves the issue.
Thank you, it seems that this solved the issue. Two questions:
1) What are the consequences of deleting the language file woocommerce-de_DE.mo? Are translations lost as a result? Do I have to retranslate anything?
2) I saw that several files with the ending “*de_DE.l10n.php” were created in the wpml folder the day before yesterday. Did you create them? Can I delete them?
This solution did not work for long. After deleting the file woocommerce-de_DE.mo, I noticed some German translations in WooCommerce are missing. For example I translated this string
"Pay via PayPal; you can pay with your credit card if you don't have a PayPal account."
to
"Mit Paypal bezahlen. Sollten Sie keinen Paypal-Account besitzen, können Sie auch mit Ihrer Kreditkarte bezahlen."
The issue immediately appeared again. It's not a solution if I can't translate the require content.
Sorry you’re still having issues. I found the problematic string causing this error. Please follow these steps:
1. Go to WPML >> String Translation.
2. Search for the “All %s” string.
3. Select the WooCommerce domain and enable “Exact match” option as you can see in the attached screenshot.
4. Update the German translation from:
Alle %
To:
Alle %s
This should resolve the issue. Could you please check and confirm?