Home›Support›English Support›[Resolved] PHP Fatal error: Uncaught ValueError: Missing format specifier at end of string
[Resolved] PHP Fatal error: Uncaught ValueError: Missing format specifier at end of string
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing a critical error when switching your WooCommerce product page to a second language, it may be due to a translation issue with placeholders in your theme files.
Solution: We found a fatal error related to incorrect placeholder translation in the theme file
on line 1014. The correct format for translating placeholders like "%1$sarticle%2$s" should maintain the 's' after the dollar sign. If the 's' is missing, it will cause an error.
To resolve this, we recommend you: 1. Visit the WPML > String Translation section. 2. Search for the problematic string. 3. Re-translate it using the correct placeholder format.
For more information on translating placeholders, please refer to the WordPress documentation.
We have already fixed the issue for the reported instance, and the translated product should now display correctly on the front end.
Before this ticket gets assigned to one of my colleagues I will try to help.
I created this custom search URL for you so that you can find the existing tickets for this exact same error message that already contain solutions recommended by my colleagues: hidden link
I hope that you will find this information helpful 🙂
Yes, I have tried the following:
- Doing extensive research about this issue before creating a ticket
- Trying to look for the error string, could not find it even with localizing all strings on the site.
- Translating All %s to all languages as it is
- Searcing %s strings and copying them as it is to other languages
- Reinstalling all WPML components
- Deactivating string plugin, this allows the site to works but checkout & cart is then broken
- Installing new language with automatic mode, the new language works, existing languages Finnish and Norwegian are broken
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.