Dieses Thema ist gelöst. Hier finden Sie eine Beschreibung des Problems und der Lösung.
Problem:
The client reported an issue where incorrect translations of strings with placeholders (like those used in
sprintf
or
printf
functions) caused errors on a PHP 8.x environment. This resulted in an inability to place orders in the shop due to a missing placeholder in the translated string.
Solution:
We acknowledged the client's feature suggestion for WPML to scan strings in the string translation table for missing placeholders. However, after reviewing the suggestion and monitoring for similar issues, we have decided not to implement this feature. We have not observed other clients experiencing this problem, and our development team has chosen not to prioritize this as a future feature.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If you're still encountering issues, 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 the problem persists, please open a new support ticket with us.
Dies ist das technische Support-Forum für WPML – das mehrsprachige WordPress-Plugin.
Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team antwortet im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.
Schlagwörter: Feature request
Dieses Thema enthält 8 Antworten, hat 3 Stimmen.
Zuletzt aktualisiert von Marcel Vor 1 Jahr.
Assistiert von: Marcel.
Verfasser | Beiträge |
---|---|
September 26, 2023 unter 8:38 am #14464541 | |
cons-2 |
I would like to submit a feature suggestion. We recently updated from PHP 7.4 to PHP 8.x. There are hard errors in PHP 8.x, for example when not all placeholders in functions like sprintf or printf can be assigned correctly. In our case, an incorrectly translated string meant that it was no longer possible to order in the shop. Example: FR translation will not work because the second placeholder is not translated correctly and the page will have an error. My suggestion: WPML should scan strings in the string translation table and display a list of strings that do not contain all placeholders and original text. |
September 26, 2023 unter 9:01 am #14464977 | |
cons-2 |
Here is a short blog article about the problem: versteckter Link |
September 26, 2023 unter 9:02 am #14464979 | |
Bruno Kos Supporter
Sprachen: Englisch (English ) Deutsch (Deutsch ) Französisch (Français ) Zeitzone: Europe/Zagreb (GMT+01:00) |
In order to submit a feature request to our team, I need to have a clear idea on the issue. Can you record a video using a tool such as versteckter Link to illustrate the issue both in the frontend and backend during the translation? This will ensure we are 100% on the scenario where this happens. |
September 26, 2023 unter 9:34 am #14465371 | |
cons-2 |
I have described errors. Here's how you can reproduce the error: If the placeholder is not translated correctly/completely, then there is a fatal error in the function that calls the string with sprintf/prinf. - It may be that a page is not displayed. Our problem was that you couldn't put products in your shopping cart in the incorrectly translated language FR. |
September 26, 2023 unter 9:39 am #14465461 | |
cons-2 |
Important: Use PHP 8.x to reduce the error. |
September 27, 2023 unter 9:07 am #14471885 | |
Marcel Supporter
Sprachen: Englisch (English ) Deutsch (Deutsch ) Zeitzone: Europe/Madrid (GMT+01:00) |
Hi, thanks for your report. When you get "Uncaught ValueError: Missing format specifier at end of", it indicates you the line where the call comes from, so you can get the exact string that is causing it from the line of code calling it. If you look at the stack trace, it will also show you the actual string, for example: #0 wp-content\plugins\woocommerce\includes\class-wc-post-types.php(234): sprintf('Alle %', 'Marke'), This way, you see that the "s" is missing. I will share it with our devs and keep you updated. Best Regards |
September 27, 2023 unter 10:44 am #14472989 | |
Marcel Supporter
Sprachen: Englisch (English ) Deutsch (Deutsch ) Zeitzone: Europe/Madrid (GMT+01:00) |
Hi, our developers decided not to implement this feature, as the ability to break the translation is possible even on WordPress without WPML. The same error would appear if you pass the wrong translation in the .mo file itself without WPML. Thanks again for providing your feedback on this matter. Best Regards |
September 27, 2023 unter 2:04 pm #14474817 | |
cons-2 |
Thanks for the feedback. What worries me about the current situation is that with deepL integration we automatically translate a lot of plugin texts and admin texts via string translation. Rarely, but now and then, there have been placeholder errors in the past that we were fortunate to notice. If we add a new language in the future, we would have to test every possible page and function on the website to find and eliminate any errors. In the ideal world, this is possible and we check the entire shop from A to Z. It would be enough to have an admin page that shows a warning if content was found in the string translation table where not all placeholders from the original language were included in the translation. Please give me a final signal of what you think about this. |
Februar 15, 2024 unter 10:28 am #15306324 | |
Marcel Supporter
Sprachen: Englisch (English ) Deutsch (Deutsch ) Zeitzone: Europe/Madrid (GMT+01:00) |
Hi there! Thanks again for bringing this to our attention. We've been keeping an eye on the issue since you reported it, and it seems like no other clients have experienced this problem. We really appreciate you sharing your feedback with us. After careful consideration, our development team has decided not to move forward with incorporating this into a future feature release. All the best, |