From: Florian Date: Tue, 22 Dec 2015 19:17:12 +0000 (+0100) Subject: Add PLURAL support and "human readable" sizes for mediastatistics messages X-Git-Tag: 1.31.0-rc.0~8529^2 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=e5769850d8af84e45e9365928f251f87fc575fdc;p=lhc%2Fweb%2Fwiklou.git Add PLURAL support and "human readable" sizes for mediastatistics messages Follow up: I4216566df4dd24 Change-Id: I2793d60c1d6ef74d32a10bb55c31a2f750f6f44b --- diff --git a/includes/specials/SpecialMediaStatistics.php b/includes/specials/SpecialMediaStatistics.php index aeebc42ddf..b49b669d8d 100644 --- a/includes/specials/SpecialMediaStatistics.php +++ b/includes/specials/SpecialMediaStatistics.php @@ -142,6 +142,7 @@ class MediaStatisticsPage extends QueryPage { $this->getOutput()->addWikiText( $this->msg( 'mediastatistics-allbytes' ) ->numParams( $this->totalSize ) + ->sizeParams( $this->totalSize ) ->text() ); } @@ -155,6 +156,8 @@ class MediaStatisticsPage extends QueryPage { $this->getOutput()->addWikiText( $this->msg( 'mediastatistics-bytespertype' ) ->numParams( $this->totalPerType ) + ->sizeParams( $this->totalPerType ) + ->numParams( $this->makePercentPretty( $this->totalPerType / $this->totalBytes ) ) ->text() ); $this->totalSize += $this->totalPerType; diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 3f761f6509..0c3310840c 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3859,8 +3859,8 @@ "mediastatistics-summary": "Statistics about uploaded file types. This only includes the most recent version of a file. Old or deleted versions of files are excluded.", "mediastatistics-nfiles": "$1 ($2%)", "mediastatistics-nbytes": "{{PLURAL:$1|$1 byte|$1 bytes}} ($2; $3%)", - "mediastatistics-bytespertype": "Total file size for this section: $1 bytes.", - "mediastatistics-allbytes": "Total file size for all files: $1 bytes.", + "mediastatistics-bytespertype": "Total file size for this section: {{PLURAL:$1|$1 byte|$1 bytes}} ($2; $3%).", + "mediastatistics-allbytes": "Total file size for all files: {{PLURAL:$1|$1 byte|$1 bytes}} ($2).", "mediastatistics-table-mimetype": "MIME type", "mediastatistics-table-extensions": "Possible extensions", "mediastatistics-table-count": "Number of files", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index dab2adc1d0..bb0dd294df 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -4034,8 +4034,8 @@ "mediastatistics-summary": "Used to explain that this page only does statistics over current versions of files. \"Old\" versions of files and deleted files are not counted.", "mediastatistics-nfiles": "{{optional}}\nEntry in table on [[Special:MediaStatistics]] that gives total number of files. $1 - number of files. $2 - percentage of total files that is this type (percent will be formatted to have about 3 interesting digits. e.g. 0.121 or 10.2)", "mediastatistics-nbytes": "Combined space of this type of file. Bytes and \"human units\" are shown so that users can better get a sense of magnitude when making comparisons.\n*$1 - total space in bytes.\n*$2 - total space in \"human units\" (i.e. KB, MB, GB, etc)\n*$3 - What percentage of the space all uploads take up does this file take up.", - "mediastatistics-bytespertype": "Combined space of one section of [[Special:MediaStatistics]]. \n*$1 - total space in bytes", - "mediastatistics-allbytes": "Combined space of all uploaded files. \n*$1 - total space in bytes", + "mediastatistics-bytespertype": "Combined space of one section of [[Special:MediaStatistics]]. \n*$1 - total space in bytes\n*$2 - total space in \"human units\" (i.e. KB, MB, GB, etc)\n*$3 - What percentage of the space all uploads take up does this file take up.", + "mediastatistics-allbytes": "Combined space of all uploaded files. \n*$1 - total space in bytes\n*$2 - total space in \"human units\" (i.e. KB, MB, GB, etc)", "mediastatistics-table-mimetype": "Header for table on Special:MediaStatistics. Column that lists MIME types (The values in this column will look like 'image/jpeg', and be linked to Special:MIMESearch).", "mediastatistics-table-extensions": "Header for column in tables on [[Special:MediaStatistics]] that lists possible extensions for a given file type. (The values in this column will be a comma separated list of file extensions, such as '.webm' or '.png, .apng').", "mediastatistics-table-count": "Column header on Special:MediaStatistics for the number of files column. The headers in this column use {{msg-mw|mediastatistics-nfiles}}.",