Migrate separator code to gettext.

This commit is contained in:
Michal Čihař
2010-05-13 11:31:34 +02:00
parent 0dcbea28eb
commit 3436ce42cc
64 changed files with 76699 additions and 76698 deletions

View File

@@ -1405,6 +1405,22 @@ function PMA_formatByteDown($value, $limes = 6, $comma = 0)
return array(trim($return_value), $unit);
} // end of the 'PMA_formatByteDown' function
/**
* Changes thousands and decimal separators to locale specific values.
*/
function PMA_localizeNumber($value)
{
return str_replace(
array(',', '.'),
array(
/* l10n: Thousands separator */
__(','),
/* l10n: Decimal separator */
__('.'),
),
$value);
}
/**
* Formats $value to the given length and appends SI prefixes
* $comma is not substracted from the length
@@ -1436,9 +1452,7 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
{
//number_format is not multibyte safe, str_replace is safe
if ($length === 0) {
return str_replace(array(',', '.'),
array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']),
number_format($value, $comma));
return PMA_localizeNumber(number_format($value, $comma));
}
// this units needs no translation, ISO
@@ -1499,9 +1513,7 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
} // end if ($value >= 1) elseif (!$only_down && (float) $value !== 0.0)
//number_format is not multibyte safe, str_replace is safe
$value = str_replace(array(',', '.'),
array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']),
number_format($value, $comma));
$value = PMA_localizeNumber(number_format($value, $comma));
return $sign . $value . ' ' . $unit;
} // end of the 'PMA_formatNumber' function

View File

@@ -17,10 +17,6 @@ $charset = 'utf-8';
/* l10n: Text direction, use either ltr or rtl */
$text_dir = __('ltr');
/* l10n: Thousands separator */
$number_thousands_separator = __(',');
/* l10n: Decimal separator */
$number_decimal_separator = __('.');
$strAbortedClients = __('Aborted');
$strAccessDenied = __('Access denied');

2500
po/af.po

File diff suppressed because it is too large Load Diff

2500
po/ar.po

File diff suppressed because it is too large Load Diff

2500
po/az.po

File diff suppressed because it is too large Load Diff

2500
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2500
po/bg.po

File diff suppressed because it is too large Load Diff

2684
po/bn.po

File diff suppressed because it is too large Load Diff

2500
po/bs.po

File diff suppressed because it is too large Load Diff

2500
po/ca.po

File diff suppressed because it is too large Load Diff

2500
po/cs.po

File diff suppressed because it is too large Load Diff

2500
po/da.po

File diff suppressed because it is too large Load Diff

2500
po/de.po

File diff suppressed because it is too large Load Diff

2500
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2500
po/es.po

File diff suppressed because it is too large Load Diff

2500
po/et.po

File diff suppressed because it is too large Load Diff

2500
po/eu.po

File diff suppressed because it is too large Load Diff

2500
po/fa.po

File diff suppressed because it is too large Load Diff

2500
po/fi.po

File diff suppressed because it is too large Load Diff

2500
po/fr.po

File diff suppressed because it is too large Load Diff

2500
po/gl.po

File diff suppressed because it is too large Load Diff

2500
po/he.po

File diff suppressed because it is too large Load Diff

2500
po/hi.po

File diff suppressed because it is too large Load Diff

2500
po/hr.po

File diff suppressed because it is too large Load Diff

2500
po/hu.po

File diff suppressed because it is too large Load Diff

2500
po/id.po

File diff suppressed because it is too large Load Diff

2500
po/it.po

File diff suppressed because it is too large Load Diff

2500
po/ja.po

File diff suppressed because it is too large Load Diff

2714
po/ka.po

File diff suppressed because it is too large Load Diff

2500
po/ko.po

File diff suppressed because it is too large Load Diff

2500
po/lt.po

File diff suppressed because it is too large Load Diff

2500
po/lv.po

File diff suppressed because it is too large Load Diff

2500
po/mk.po

File diff suppressed because it is too large Load Diff

2500
po/mn.po

File diff suppressed because it is too large Load Diff

2500
po/ms.po

File diff suppressed because it is too large Load Diff

2500
po/nb.po

File diff suppressed because it is too large Load Diff

2500
po/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2500
po/pl.po

File diff suppressed because it is too large Load Diff

2500
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2590
po/ro.po

File diff suppressed because it is too large Load Diff

2500
po/ru.po

File diff suppressed because it is too large Load Diff

2684
po/si.po

File diff suppressed because it is too large Load Diff

2500
po/sk.po

File diff suppressed because it is too large Load Diff

2500
po/sl.po

File diff suppressed because it is too large Load Diff

2500
po/sq.po

File diff suppressed because it is too large Load Diff

2500
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2500
po/sv.po

File diff suppressed because it is too large Load Diff

2500
po/ta.po

File diff suppressed because it is too large Load Diff

2500
po/te.po

File diff suppressed because it is too large Load Diff

2500
po/th.po

File diff suppressed because it is too large Load Diff

2500
po/tr.po

File diff suppressed because it is too large Load Diff

2500
po/tt.po

File diff suppressed because it is too large Load Diff

2500
po/uk.po

File diff suppressed because it is too large Load Diff

2500
po/ur.po

File diff suppressed because it is too large Load Diff

2500
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

@@ -79,9 +79,6 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase
*/
public function testFormatNumber($a, $b, $c, $e) {
$GLOBALS['number_thousands_separator'] = ' ';
$GLOBALS['number_decimal_separator'] = ',';
$this->assertEquals($e, (string)PMA_formatNumber($a, $b, $c, false));
}
@@ -107,10 +104,6 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase
*/
public function testFormatByteDown($a, $b, $c, $e) {
$GLOBALS['number_thousands_separator'] = ' ';
$GLOBALS['number_decimal_separator'] = ',';
$result = PMA_formatByteDown($a, $b, $c);
$result[0] = trim($result[0]);
$this->assertEquals($e, $result);