Skip Navigation

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

Problem:
You are experiencing a fatal error caused by WPML String Translation when translations are loaded and the file path contains a % character, leading to a PHP Fatal error due to an unescaped % in

$file_path

.
Solution:
Currently, there is no permanent fix available for this issue. However, you can use the following temporary workaround:

$file_type = isset( $pathinfo['extension'] ) ? $pathinfo['extension'] : null;<br />$file_path = str_replace('%', '', $file_path);

For more details, please refer to our errata page: https://wpml.org/errata/flux-checkout-fatal-error-uncaught-valueerror-unknown-format-specifier-t/.

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 issue 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.

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Andrey 1 month, 1 week ago.

Assisted by: Andrey.

Author Posts
May 26, 2025 at 6:44 am #17070996

kevinR-12

Background of the issue:
I am trying to prevent a fatal error caused by WPML String Translation when translations are loaded and the file path contains a % character. The error happens in this file: /wp-content/plugins/wpml-string-translation/classes/translations-file-scan/wpml-st-translations-file-registration.php. A WPML moderator already suggested this fix in 2023 (https://wpml.org/forums/topic/php-fatal-error-uncaught-valueerror-unknown-format-specifier-in-wpml-string-t/): $file_type = isset( $pathinfo['extension'] ) ? $pathinfo['extension'] : null; $file_path = str_replace('%', '', $file_path); // Temporary workaround. Link to a page where the issue can be seen: hidden link (private platform, error occurs after login).

Symptoms:
A fatal PHP error that breaks the site: PHP Fatal error: Uncaught ValueError: Unknown format specifier "t" in wpml-st-translations-file-registration.php on line 100. Full stack trace points to the use of sprintf() with an unescaped % in $file_path. This happens on page load and prevents normal site operation when translations are loaded early (e.g. LearnDash, WPML, SureMembers, Presto Player, etc.).

Questions:
How can I prevent the fatal error caused by WPML String Translation when the file path contains a % character?
Is there a permanent fix for the sprintf() issue with unescaped % in $file_path?

May 26, 2025 at 2:26 pm #17074033

Andrey
WPML Supporter since 06/2013

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

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

Thank you for contacting WPML support.

I want to inform you that our development team has noted the issue and is currently on their to-do list. Unfortunately, we do not have a permanent fix available at this time. In the meantime, you can continue to use the provided workaround.

For related details, refer to the following link: https://wpml.org/errata/flux-checkout-fatal-error-uncaught-valueerror-unknown-format-specifier-t/.

While you may not be using the exact plugin mentioned in the errata, it is possible that one of your active plugins is registering a text domain in an undesirable manner, which could be causing the issue.