Move byte units translations to proper place.

This commit is contained in:
Michal Čihař
2010-05-13 11:26:54 +02:00
parent 588a63e6c0
commit 0dcbea28eb
64 changed files with 78536 additions and 78475 deletions

View File

@@ -1375,21 +1375,24 @@ function PMA_profilingResults($profiling_results)
*/
function PMA_formatByteDown($value, $limes = 6, $comma = 0)
{
/* l10n: shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa+ */
$byteUnits = array(__('B'), __('KiB'), __('MiB'), __('GiB'), __('TiB'), __('PiB'), __('EiB'));
$dh = PMA_pow(10, $comma);
$li = PMA_pow(10, $limes);
$return_value = $value;
$unit = $GLOBALS['byteUnits'][0];
$unit = $byteUnits[0];
for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) {
if (isset($GLOBALS['byteUnits'][$d]) && $value >= $li * PMA_pow(10, $ex)) {
if (isset($byteUnits[$d]) && $value >= $li * PMA_pow(10, $ex)) {
// use 1024.0 to avoid integer overflow on 64-bit machines
$value = round($value / (PMA_pow(1024, $d) / $dh)) /$dh;
$unit = $GLOBALS['byteUnits'][$d];
$unit = $byteUnits[$d];
break 1;
} // end if
} // end for
if ($unit != $GLOBALS['byteUnits'][0]) {
if ($unit != $byteUnits[0]) {
// if the unit is not bytes (as represented in current language)
// reformat with max length of 5
// 4th parameter=true means do not reformat if value < 1

View File

@@ -21,8 +21,6 @@ $text_dir = __('ltr');
$number_thousands_separator = __(',');
/* l10n: Decimal separator */
$number_decimal_separator = __('.');
// shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa
$byteUnits = array(__('B'), __('KiB'), __('MiB'), __('GiB'), __('TiB'), __('PiB'), __('EiB'));
$strAbortedClients = __('Aborted');
$strAccessDenied = __('Access denied');

2537
po/af.po

File diff suppressed because it is too large Load Diff

2537
po/ar.po

File diff suppressed because it is too large Load Diff

2537
po/az.po

File diff suppressed because it is too large Load Diff

2537
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2537
po/bg.po

File diff suppressed because it is too large Load Diff

2991
po/bn.po

File diff suppressed because it is too large Load Diff

2537
po/bs.po

File diff suppressed because it is too large Load Diff

2537
po/ca.po

File diff suppressed because it is too large Load Diff

2537
po/cs.po

File diff suppressed because it is too large Load Diff

2537
po/da.po

File diff suppressed because it is too large Load Diff

2537
po/de.po

File diff suppressed because it is too large Load Diff

2537
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2537
po/es.po

File diff suppressed because it is too large Load Diff

2537
po/et.po

File diff suppressed because it is too large Load Diff

2537
po/eu.po

File diff suppressed because it is too large Load Diff

2537
po/fa.po

File diff suppressed because it is too large Load Diff

2537
po/fi.po

File diff suppressed because it is too large Load Diff

2537
po/fr.po

File diff suppressed because it is too large Load Diff

2537
po/gl.po

File diff suppressed because it is too large Load Diff

2537
po/he.po

File diff suppressed because it is too large Load Diff

2537
po/hi.po

File diff suppressed because it is too large Load Diff

2537
po/hr.po

File diff suppressed because it is too large Load Diff

2537
po/hu.po

File diff suppressed because it is too large Load Diff

2537
po/id.po

File diff suppressed because it is too large Load Diff

2537
po/it.po

File diff suppressed because it is too large Load Diff

2537
po/ja.po

File diff suppressed because it is too large Load Diff

3029
po/ka.po

File diff suppressed because it is too large Load Diff

2537
po/ko.po

File diff suppressed because it is too large Load Diff

2537
po/lt.po

File diff suppressed because it is too large Load Diff

2537
po/lv.po

File diff suppressed because it is too large Load Diff

2537
po/mk.po

File diff suppressed because it is too large Load Diff

2537
po/mn.po

File diff suppressed because it is too large Load Diff

2537
po/ms.po

File diff suppressed because it is too large Load Diff

2537
po/nb.po

File diff suppressed because it is too large Load Diff

2537
po/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2537
po/pl.po

File diff suppressed because it is too large Load Diff

2537
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2911
po/ro.po

File diff suppressed because it is too large Load Diff

2537
po/ru.po

File diff suppressed because it is too large Load Diff

2991
po/si.po

File diff suppressed because it is too large Load Diff

2537
po/sk.po

File diff suppressed because it is too large Load Diff

2537
po/sl.po

File diff suppressed because it is too large Load Diff

2537
po/sq.po

File diff suppressed because it is too large Load Diff

2537
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2537
po/sv.po

File diff suppressed because it is too large Load Diff

2537
po/ta.po

File diff suppressed because it is too large Load Diff

2537
po/te.po

File diff suppressed because it is too large Load Diff

2537
po/th.po

File diff suppressed because it is too large Load Diff

2537
po/tr.po

File diff suppressed because it is too large Load Diff

2537
po/tt.po

File diff suppressed because it is too large Load Diff

2537
po/uk.po

File diff suppressed because it is too large Load Diff

2537
po/ur.po

File diff suppressed because it is too large Load Diff

2537
po/uz.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,7 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase
$this->tmpGlobals = $GLOBALS;
$this->tmpSession = $_SESSION;
}
/**
@@ -107,10 +107,9 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase
*/
public function testFormatByteDown($a, $b, $c, $e) {
$GLOBALS['byteUnits'] = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
$GLOBALS['number_thousands_separator'] = ' ';
$GLOBALS['number_decimal_separator'] = ',';
$result = PMA_formatByteDown($a, $b, $c);
$result[0] = trim($result[0]);