Skip to content Skip to sidebar

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 10 replies, has 0 voices.

Last updated by dominikS-33 2 days, 20 hours ago.

Assisted by: Noman.

Author Posts
July 15, 2025 at 9:05 am

dominikS-33

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?

July 15, 2025 at 10:40 am
July 15, 2025 at 10:42 am #17237337

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

Thank you

July 15, 2025 at 10:44 am #17237338

dominikS-33

Hello, how can we solve the issue?

July 15, 2025 at 10:59 am #17237432

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Reference to our chat https://wpml.org/forums/topic/cirital-error-when-changing-to-php-8-x-2/ about this very issue, I've set your next reply as private to provide the detail securely, as asked by my colleague.

Regards.

July 15, 2025 at 11:02 am
July 15, 2025 at 11:24 am #17237503

dominikS-33

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.

July 15, 2025 at 5:34 pm
July 15, 2025 at 5:35 pm #17239144

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

Thank you for your cooperation

July 16, 2025 at 5:44 am #17240022

dominikS-33

I have done the migration.

July 16, 2025 at 4:49 pm #17243073

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

Here is errata for more details:
https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/

Thank you for your cooperation

July 17, 2025 at 5:54 am #17243959

dominikS-33

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?

July 17, 2025 at 6:24 am #17243987

dominikS-33

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.

July 17, 2025 at 6:29 pm #17247679

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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?

Thank you for your cooperation and patience

problematic string.jpg
After fixing that string.jpg
July 20, 2025 at 2:07 pm #17253082

dominikS-33

Thank you, this solved the issue.