Add PLURAL support and "human readable" sizes for mediastatistics messages
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Tue, 22 Dec 2015 19:17:12 +0000 (20:17 +0100)
committerLegoktm <legoktm.wikipedia@gmail.com>
Sun, 27 Dec 2015 05:41:49 +0000 (05:41 +0000)
Follow up: I4216566df4dd24

Change-Id: I2793d60c1d6ef74d32a10bb55c31a2f750f6f44b

includes/specials/SpecialMediaStatistics.php
languages/i18n/en.json
languages/i18n/qqq.json

index aeebc42..b49b669 100644 (file)
@@ -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;
index 3f761f6..0c33108 100644 (file)
        "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",
index dab2adc..bb0dd29 100644 (file)
        "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}}.",