French translation mistake causes Fatal error
-
The French translation contains an unescaped % character in a string that causes a Fatal error (at least with PHP 8.2) on the Images configuration page.
Steps to reproduce
Install and activate WP-Optimize on a vanilla site with the Site Language set to French.
Browse to WP-Optimize > Images
A Fatal error will be thrown:[12-Jul-2023 12:28:43 UTC] PHP Fatal error: Uncaught ArgumentCountError: 5 arguments are required, 4 given in /path/wp-content/plugins/wp-optimize/includes/class-updraft-smush-manager-commands.php:175 Stack trace: #0 /path/wp-content/plugins/wp-optimize/includes/class-updraft-smush-manager-commands.php(175): sprintf('Depuis la derni...', '6', '0 bytes', '0.00%') #1 /path/wp-content/plugins/wp-optimize/includes/class-updraft-smush-manager.php(190): Updraft_Smush_Manager_Commands->get_ui_update(Array) #2 /path/wp-includes/class-wp-hook.php(308): Updraft_Smush_Manager->updraft_smush_ajax('') #3 /path/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #4 /path/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /path/wp-admin/admin-ajax.php(188): do_action('wp_ajax_updraft...') #6 {main} thrown in /path/wp-content/plugins/wp-optimize/includes/class-updraft-smush-manager-commands.php on line 175
Expected behaviour: a list of Uncompressed images.
Actual behaviour: a fatal error (not visible in the admin page), and no images in the list.
Cause and fix
A string in the French translation contains an unescaped % character. As in the other languages, it should be replaced with the word for “percent”, “pourcent”. I suggested the change on the aforementioned link.
The extra, unescaped % character makes the sprintf() function throw an error because it is expecting one more argument.
The page I need help with: [log in to see the link]
- The topic ‘French translation mistake causes Fatal error’ is closed to new replies.