From b459cddeafc02385dc23b94d8323a51b3231cd9e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 6 Jan 2020 16:14:30 +0000 Subject: [PATCH] I18N: Replace `php.ini`, `post_max_size`, and `upload_max_filesize` with placeholders in "File is empty" error message. Props ramiy. Fixes #48868. git-svn-id: https://develop.svn.wordpress.org/trunk@47043 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/file.php | 8 +++++++- src/wp-admin/includes/import.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index a47fd79826..a28ac46098 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -804,7 +804,13 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) { if ( is_multisite() ) { $error_msg = __( 'File is empty. Please upload something more substantial.' ); } else { - $error_msg = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ); + $error_msg = sprintf( + /* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */ + __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ), + 'php.ini', + 'post_max_size', + 'upload_max_filesize' + ); } return call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) ); } diff --git a/src/wp-admin/includes/import.php b/src/wp-admin/includes/import.php index 7b6ff88641..27aa8aa4f2 100644 --- a/src/wp-admin/includes/import.php +++ b/src/wp-admin/includes/import.php @@ -82,7 +82,13 @@ function wp_import_cleanup( $id ) { function wp_import_handle_upload() { if ( ! isset( $_FILES['import'] ) ) { return array( - 'error' => __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ), + 'error' => sprintf( + /* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */ + __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ), + 'php.ini', + 'post_max_size', + 'upload_max_filesize' + ), ); }