From 2f5b5baa07839c6f22afa7e53e7f7273a33a18f5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 1 Apr 2019 12:24:51 +0000 Subject: [PATCH] I18N: Merge similar strings about allowed space allocation in Multisite. Props ramiy, Jonathandejong, pento. Fixes #42223. Built from https://develop.svn.wordpress.org/trunk@45082 git-svn-id: http://core.svn.wordpress.org/trunk@44891 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 6 +++++- wp-admin/includes/ms-deprecated.php | 21 +++++++++++++-------- wp-admin/includes/ms.php | 8 ++++++-- wp-includes/class-wp-xmlrpc-server.php | 9 ++++++++- wp-includes/version.php | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 58dc569b80..b07f4e5bc8 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -2898,7 +2898,11 @@ function media_upload_max_image_resize() { * @since 3.5.0 */ function multisite_over_quota_message() { - echo '

' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '

'; + echo '

' . sprintf( + /* translators: %s: allowed space allocation */ + __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ), + size_format( get_space_allowed() * MB_IN_BYTES ) + ) . '

'; } /** diff --git a/wp-admin/includes/ms-deprecated.php b/wp-admin/includes/ms-deprecated.php index 4a06e66c6e..811fda7481 100644 --- a/wp-admin/includes/ms-deprecated.php +++ b/wp-admin/includes/ms-deprecated.php @@ -16,7 +16,7 @@ * @deprecated 3.0.0 */ function wpmu_menu() { - _deprecated_function(__FUNCTION__, '3.0.0' ); + _deprecated_function( __FUNCTION__, '3.0.0' ); // Deprecated. See #11763. } @@ -27,10 +27,15 @@ function wpmu_menu() { * @see is_upload_space_available() */ function wpmu_checkAvailableSpace() { - _deprecated_function(__FUNCTION__, '3.0.0', 'is_upload_space_available()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'is_upload_space_available()' ); - if ( !is_upload_space_available() ) - wp_die( __('Sorry, you must delete files before you can upload any more.') ); + if ( ! is_upload_space_available() ) { + wp_die( sprintf( + /* translators: %s: allowed space allocation */ + __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ), + size_format( get_space_allowed() * MB_IN_BYTES ) + ) ); + } } /** @@ -39,7 +44,7 @@ function wpmu_checkAvailableSpace() { * @deprecated 3.0.0 */ function mu_options( $options ) { - _deprecated_function(__FUNCTION__, '3.0.0' ); + _deprecated_function( __FUNCTION__, '3.0.0' ); return $options; } @@ -50,7 +55,7 @@ function mu_options( $options ) { * @see activate_plugin() */ function activate_sitewide_plugin() { - _deprecated_function(__FUNCTION__, '3.0.0', 'activate_plugin()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'activate_plugin()' ); return false; } @@ -61,7 +66,7 @@ function activate_sitewide_plugin() { * @see deactivate_plugin() */ function deactivate_sitewide_plugin( $plugin = false ) { - _deprecated_function(__FUNCTION__, '3.0.0', 'deactivate_plugin()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'deactivate_plugin()' ); } /** @@ -71,7 +76,7 @@ function deactivate_sitewide_plugin( $plugin = false ) { * @see is_network_only_plugin() */ function is_wpmu_sitewide_plugin( $file ) { - _deprecated_function(__FUNCTION__, '3.0.0', 'is_network_only_plugin()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'is_network_only_plugin()' ); return is_network_only_plugin( $file ); } diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 4cae500402..4a2934b875 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -226,7 +226,11 @@ function upload_is_user_over_quota( $echo = true ) { if ( ( $space_allowed - $space_used ) < 0 ) { if ( $echo ) { - _e( 'Sorry, you have used your space allocation. Please delete some files to upload more files.' ); + printf( + /* translators: %s: allowed space allocation */ + __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ), + size_format( $space_allowed * MB_IN_BYTES ) + ); } return true; } else { @@ -1002,7 +1006,7 @@ function confirm_delete_users( $users ) { endif; submit_button( __( 'Confirm Deletion' ), 'primary' ); - ?> +?> error = new IXR_Error( 401, __( 'Sorry, you have used your space allocation.' ) ); + $this->error = new IXR_Error( + 401, + sprintf( + /* translators: %s: allowed space allocation */ + __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ), + size_format( get_space_allowed() * MB_IN_BYTES ) + ) + ); return $this->error; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2cb067d396..080f67f185 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta1-45081'; +$wp_version = '5.2-beta1-45082'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.