Making WordPress.org

Opened 4 years ago

Closed 4 years ago

#5221 closed enhancement (reported-upstream)

Plugin directory: i18n of max file size for upload

Reported by: tobifjellner's profile tobifjellner Owned by:
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

Location:
http://meta.svn.wordpress.org/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

The function public static function get_max_allowed_file_size() just concatenates a number and a unit.

  1. The unit label should be available for translation.
  2. Some languages don't write numbers and their related unit directly after each other. So this format would need to be i18n-alized, along the lines of:

%1$s%2$s context: "max-file-size" 1. Number ; 2. Measurement unit (bytes, kb, mb, etc.)

Attachments (2)

5221.patch (2.9 KB) - added by ocean90 4 years ago.
5221.2.patch (3.3 KB) - added by ocean90 4 years ago.
Includes https://meta.trac.wordpress.org/changeset/9886 for the theme directory

Download all attachments as: .zip

Change History (6)

#1 @Otto42
4 years ago

No need to be complicated about it. Do what core does, and use size_format(). See wp-admin/includes/media.php:

printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );

This gets its translations and such using number_format_i18n.

@ocean90
4 years ago

#2 @ocean90
4 years ago

  • Type changed from defect to enhancement

@Otto42 Thanks, I was also wondering why it doesn't use size_format(). 5221.patch also updates the theme directory.

Related: #WP50194

@ocean90
4 years ago

Includes https://meta.trac.wordpress.org/changeset/9886 for the theme directory

#3 @ocean90
4 years ago

In 9887:

Theme/Plugin Directory: Use size_format() when displaying allowed upload file size.

See #5221.

#4 @ocean90
4 years ago

  • Resolution set to reported-upstream
  • Status changed from new to closed

Further enhancements will be added via #WP50194.

Note: See TracTickets for help on using tickets.