Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#42223 closed defect (bug) (fixed)

Merge two similar translation strings when using get_space_allowed()

Reported by: ramiy's profile ramiy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch has-screenshots needs-refresh
Focuses: multisite Cc:

Description

Both multisite_over_quota_message() and upload_is_user_over_quota() output similar error messages when the passing the allowed storage quota. The first is for multisite and the second is for the media library, but both functions use get_space_allowed().

  1. Sorry, you have used all of your storage quota of %s MB.
  1. Sorry, you have used your space allocation. Please delete some files to upload more files.

Those two messages can be merged into one:

  • Sorry, you have used your space allocation of %s MB. Please delete some files to upload more files.

Attachments (5)

42223.png (20.0 KB) - added by ramiy 7 years ago.
42223.patch (1.1 KB) - added by ramiy 7 years ago.
42223.2.patch (1.2 KB) - added by ramiy 7 years ago.
Add translators comments
42223-3.patch (357.3 KB) - added by Jonathandejong 6 years ago.
42223-4.patch (1.3 KB) - added by Jonathandejong 6 years ago.
fixes -3.patch

Download all attachments as: .zip

Change History (16)

@ramiy
7 years ago

@ramiy
7 years ago

#1 @ramiy
7 years ago

  • Focuses multisite added
  • Keywords has-patch has-screenshots added

@ramiy
7 years ago

Add translators comments

#2 @ramiy
7 years ago

We can also merge the string used in the deprecated wpmu_checkAvailableSpace() function.

This ticket was mentioned in Slack in #core-i18n by ramiy. View the logs.


7 years ago

#4 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 5.0

A similar string is also used in wp_xmlrpc_server::mw_newMediaObject().

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


7 years ago

#6 @Jonathandejong
6 years ago

Apologies, added a bit too much.. new patch coming right up.

@Jonathandejong
6 years ago

fixes -3.patch

#7 @pento
6 years ago

  • Milestone changed from 5.0 to 5.1

#8 @pento
6 years ago

  • Keywords needs-refresh added
  • Milestone changed from 5.1 to 5.2

Instead of %s MB, this would probably be better if we took the return value of get_space_used(), multiply it by MB_IN_BYTES, and feed that number to size_format(). Given that sites have fairly large size limits these days, limiting it to MB is going to make for some large numbers.

#9 @ramiy
6 years ago

@pento

For now we can use %s placeholder in the translation string.

Later, if we will decide to change the value, it won't affect the translation string.

#10 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45082:

I18N: Merge similar strings about allowed space allocation in Multisite.

Props ramiy, Jonathandejong, pento.
Fixes #42223.

#11 @SergeyBiryukov
6 years ago

In 45084:

PHPCS: Fix WPCS violation in [45082].

See #42223.

Note: See TracTickets for help on using tickets.