Language: Handle ronna and quetta
* https://en.wikipedia.org/wiki/Ronna- * https://en.wikipedia.org/wiki/Quetta- Change-Id: I91ca723b7ca1b3d7dd5721b2d041715f566e7758
This commit is contained in:
parent
ce73c23fea
commit
49f3b0dd56
5 changed files with 41 additions and 8 deletions
|
|
@ -4697,7 +4697,7 @@ class Language {
|
|||
|
||||
/**
|
||||
* Format a bitrate for output, using an appropriate
|
||||
* unit (bps, kbps, Mbps, Gbps, Tbps, Pbps, Ebps, Zbps or Ybps) according to
|
||||
* unit (bps, kbps, Mbps, Gbps, Tbps, Pbps, Ebps, Zbps, Ybps, Rbps or Qbps) according to
|
||||
* the magnitude in question.
|
||||
*
|
||||
* This use base 1000. For base 1024 use formatSize(), for another base
|
||||
|
|
@ -4708,7 +4708,8 @@ class Language {
|
|||
*/
|
||||
public function formatBitrate( $bps ) {
|
||||
// messages used: bitrate-bits, bitrate-kilobits, bitrate-megabits, bitrate-gigabits, bitrate-terabits,
|
||||
// bitrate-petabits, bitrate-exabits, bitrate-zettabits, bitrate-yottabits
|
||||
// bitrate-petabits, bitrate-exabits, bitrate-zettabits, bitrate-yottabits, bitrate-ronnabits,
|
||||
// bitrate-quettabits
|
||||
return $this->formatComputingNumbers( $bps, 1000, "bitrate-$1bits" );
|
||||
}
|
||||
|
||||
|
|
@ -4724,7 +4725,7 @@ class Language {
|
|||
$this->getMessageFromDB( str_replace( '$1', '', $messageKey ) )
|
||||
);
|
||||
}
|
||||
$sizes = [ '', 'kilo', 'mega', 'giga', 'tera', 'peta', 'exa', 'zetta', 'yotta' ];
|
||||
$sizes = [ '', 'kilo', 'mega', 'giga', 'tera', 'peta', 'exa', 'zetta', 'yotta', 'ronna', 'quetta' ];
|
||||
$index = 0;
|
||||
|
||||
$maxIndex = count( $sizes ) - 1;
|
||||
|
|
@ -4748,7 +4749,7 @@ class Language {
|
|||
|
||||
/**
|
||||
* Format a size in bytes for output, using an appropriate
|
||||
* unit (B, KB, MB, GB, TB, PB, EB, ZB or YB) according to the magnitude in question
|
||||
* unit (B, KB, MB, GB, TB, PB, EB, ZB, YB, RB or QB) according to the magnitude in question
|
||||
*
|
||||
* This method use base 1024. For base 1000 use formatBitrate(), for
|
||||
* another base see formatComputingNumbers()
|
||||
|
|
@ -4758,7 +4759,7 @@ class Language {
|
|||
*/
|
||||
public function formatSize( $size ) {
|
||||
// messages used: size-bytes, size-kilobytes, size-megabytes, size-gigabytes, size-terabytes,
|
||||
// size-petabytes, size-exabytes, size-zettabytes, size-yottabytes
|
||||
// size-petabytes, size-exabytes, size-zettabytes, size-yottabytes, size-ronnabytes, size-quettabytes
|
||||
return $this->formatComputingNumbers( $size, 1024, "size-$1bytes" );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class TransformTooBigImageAreaError extends MediaTransformError {
|
|||
$msg = wfMessage( 'thumbnail_toobigimagearea' );
|
||||
$msg->params(
|
||||
// messages used: size-pixel, size-kilopixel, size-megapixel, size-gigapixel, size-terapixel,
|
||||
// size-petapixel, size-exapixel, size-zettapixel, size-yottapixel
|
||||
// size-petapixel, size-exapixel, size-zettapixel, size-yottapixel, size-ronnapixel, size-quettapixel
|
||||
$msg->getLanguage()->formatComputingNumbers( $maxImageArea, 1000, "size-$1pixel" )
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -3578,6 +3578,8 @@
|
|||
"size-exabytes": "$1 EB",
|
||||
"size-zettabytes": "$1 ZB",
|
||||
"size-yottabytes": "$1 YB",
|
||||
"size-ronnabytes": "$1 RB",
|
||||
"size-quettabytes": "$1 QB",
|
||||
"size-pixel": "$1 {{PLURAL:$1|pixel|pixels}}",
|
||||
"size-kilopixel": "$1 KP",
|
||||
"size-megapixel": "$1 MP",
|
||||
|
|
@ -3587,6 +3589,8 @@
|
|||
"size-exapixel": "$1 EP",
|
||||
"size-zettapixel": "$1 ZP",
|
||||
"size-yottapixel": "$1 YP",
|
||||
"size-ronnapixel": "$1 RP",
|
||||
"size-quettapixel": "$1 QP",
|
||||
"bitrate-bits": "$1 bps",
|
||||
"bitrate-kilobits": "$1 kbps",
|
||||
"bitrate-megabits": "$1 Mbps",
|
||||
|
|
@ -3596,6 +3600,8 @@
|
|||
"bitrate-exabits": "$1 Ebps",
|
||||
"bitrate-zettabits": "$1 Zbps",
|
||||
"bitrate-yottabits": "$1 Ybps",
|
||||
"bitrate-ronnabits": "$1 Rbps",
|
||||
"bitrate-quettabits": "$1 Qbps",
|
||||
"lag-warn-normal": "Changes newer than $1 {{PLURAL:$1|second|seconds}} may not be shown in this list.",
|
||||
"lag-warn-high": "Due to high database server lag, changes newer than $1 {{PLURAL:$1|second|seconds}} may not be shown in this list.",
|
||||
"editwatchlist-summary": "",
|
||||
|
|
|
|||
|
|
@ -3821,6 +3821,8 @@
|
|||
"size-exabytes": "{{optional}}\nSize (of a file, typically) in exbibytes (1 exbibytes = 1024×1024×1024×1024×1024×1024 bytes).",
|
||||
"size-zettabytes": "{{optional}}\nSize (of a file, typically) in zebibytes (1 zebibytes = 1024×1024×1024×1024×1024×1024×1024 bytes).",
|
||||
"size-yottabytes": "{{optional}}\nSize (of a file, typically) in yobibytes (1 yobibytes = 1024×1024×1024×1024×1024×1024×1024×1024 bytes).",
|
||||
"size-ronnabytes": "{{optional}}\nSize (of a file, typically). A formal name for this unit has yet to be established, but for the message itself, the abbreviation should be the same as 1 ronnabyte, where ronna (R) is the standard decimal SI prefix for 10<sup>27</sup>. (1×1024×1024×1024×1024×1024×1024×1024×1024×1024 bytes)",
|
||||
"size-quettabytes": "{{optional}}\nSize (of a file, typically). A formal name for this unit has yet to be established, but for the message itself, the abbreviation should be the same as 1 quettabyte, where quetta (Q) is the standard decimal SI prefix for 10<sup>30</sup>. (1×1024×1024×1024×1024×1024×1024×1024×1024×1024×1024 bytes)",
|
||||
"size-pixel": "Size (of a file, typically) in pixel.\n{{Identical|Pixel}}",
|
||||
"size-kilopixel": "{{optional}}\nSize (of an image, typically) in kilopixels (1 kilopixel = 1000 pixel).",
|
||||
"size-megapixel": "{{optional}}\nSize (of a file, typically) in megapixel (1 megapixel = 1000×1000 pixel).",
|
||||
|
|
@ -3830,6 +3832,8 @@
|
|||
"size-exapixel": "{{optional}}\nSize (of a file, typically) in exapixel (1 exapixel = 1000×1000×1000×1000×1000×1000 pixel).",
|
||||
"size-zettapixel": "{{optional}}\nSize (of a file, typically) in zettapixel (1 zettapixel = 1000×1000×1000×1000×1000×1000×1000 pixel).",
|
||||
"size-yottapixel": "{{optional}}\nSize (of a file, typically) in yottapixel (1 yottapixel = 1000×1000×1000×1000×1000×1000×1000×1000 pixel).",
|
||||
"size-ronnapixel": "{{optional}}\nSize (of a file, typically) in ronnapixel (1 ronnapixel = 1000×1000×1000×1000×1000×1000×1000×1000×1000 pixel).",
|
||||
"size-quettapixel": "{{optional}}\nSize (of a file, typically) in quettapixel (1 quettapixel = 1000×1000×1000×1000×1000×1000×1000×1000×1000 pixel).",
|
||||
"bitrate-bits": "{{optional}}\nBitrate (of a file, typically) in bits.",
|
||||
"bitrate-kilobits": "{{optional}}\nBitrate (of a file, typically) in kilobits (1 kilobit = 1000 bits).",
|
||||
"bitrate-megabits": "{{optional}}\nBitrate (of a file, typically) in megabits (1 megabits = 1000×1000 bits).",
|
||||
|
|
@ -3839,6 +3843,8 @@
|
|||
"bitrate-exabits": "{{optional}}\nBitrate (of a file, typically) in exabits (1 exabits = 1000×1000×1000×1000×1000×1000 bits).",
|
||||
"bitrate-zettabits": "{{optional}}\nBitrate (of a file, typically) in zettabits (1 zettabits = 1000×1000×1000×1000×1000×1000×1000 bits).",
|
||||
"bitrate-yottabits": "{{optional}}\nBitrate (of a file, typically) in yottabits (1 yottabits = 1000×1000×1000×1000×1000×1000×1000×1000 bits).",
|
||||
"bitrate-ronnabits": "{{optional}}\nBitrate (of a file, typically) in ronnabits (1 ronnabits = 1000×1000×1000×1000×1000×1000×1000×1000×1000 bits).",
|
||||
"bitrate-quettabits": "{{optional}}\nBitrate (of a file, typically) in quettabits (1 quettabits = 1000×1000×1000×1000×1000×1000×1000×1000×1000×1000 bits).",
|
||||
"lag-warn-normal": "Used as warning about replica lag. Parameters:\n* $1 - number of seconds\nSee also:\n* {{msg-mw|Lag-warn-high}}",
|
||||
"lag-warn-high": "Used as warning about replica lag. Parameters:\n* $1 - number of seconds\nSee also:\n* {{msg-mw|Lag-warn-normal}}",
|
||||
"editwatchlist-summary": "{{doc-specialpagesummary|editwatchlist}}",
|
||||
|
|
|
|||
|
|
@ -1149,6 +1149,16 @@ class LanguageIntegrationTest extends LanguageClassesTestCase {
|
|||
"1 YB",
|
||||
"1 yottabyte"
|
||||
],
|
||||
[
|
||||
1024 ** 9,
|
||||
"1 RB",
|
||||
"1 ronnabyte"
|
||||
],
|
||||
[
|
||||
1024 ** 10,
|
||||
"1 QB",
|
||||
"1 quettabyte"
|
||||
],
|
||||
// How big!? THIS BIG!
|
||||
];
|
||||
}
|
||||
|
|
@ -1219,8 +1229,18 @@ class LanguageIntegrationTest extends LanguageClassesTestCase {
|
|||
],
|
||||
[
|
||||
10 ** 27,
|
||||
"1,000 Ybps",
|
||||
"1,000 yottabits per second"
|
||||
"1 Rbps",
|
||||
"1 ronnabits per second"
|
||||
],
|
||||
[
|
||||
10 ** 30,
|
||||
"1 Qbps",
|
||||
"1 quettabit per second"
|
||||
],
|
||||
[
|
||||
10 ** 33,
|
||||
"1,000 Qbps",
|
||||
"1,000 quettabits per second"
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue