From 3ff0ef5030e02096fde762f69ab52e3f9f6f12e7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 20 Feb 2020 17:16:21 +0000 Subject: [PATCH] I18N: Replace `upload_max_filesize`, `php.ini`, `MAX_FILE_SIZE` with placeholders in upload error strings. Props ramiy. Fixes #48869. git-svn-id: https://develop.svn.wordpress.org/trunk@47330 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/file.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index b30b2c2083..007b88f9a0 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -765,8 +765,17 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) { // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. $upload_error_strings = array( false, - __( 'The uploaded file exceeds the upload_max_filesize directive in php.ini.' ), - __( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.' ), + sprintf( + /* translators: 1: upload_max_filesize, 2: php.ini */ + __( 'The uploaded file exceeds the %1$s directive in %2$s.' ), + 'upload_max_filesize', + 'php.ini' + ), + sprintf( + /* translators: %s: MAX_FILE_SIZE */ + __( 'The uploaded file exceeds the %s directive that was specified in the HTML form.' ), + 'MAX_FILE_SIZE' + ), __( 'The uploaded file was only partially uploaded.' ), __( 'No file was uploaded.' ), '',