Translate numbers in ar, bn, fa

This commit is contained in:
Jakub Vrana 2014-03-19 21:56:42 -07:00
parent 73629178d8
commit 4d491d704e
39 changed files with 49 additions and 8 deletions

View file

@ -519,5 +519,5 @@ function db_size($db) {
foreach (table_status() as $table_status) {
$return += $table_status["Data_length"] + $table_status["Index_length"];
}
return number_format($return, 0, '.', lang(','));
return format_number($return);
}

View file

@ -723,6 +723,14 @@ function shorten_utf8($string, $length = 80, $suffix = "") {
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
}
/** Format decimal number
* @param int
* @return string
*/
function format_number($val) {
return strtr(number_format($val, 0, ".", lang(',')), preg_split('~~u', lang('0123456789'), -1, PREG_SPLIT_NO_EMPTY));
}
/** Generate friendly URL
* @param string
* @return string

View file

@ -68,7 +68,7 @@ function lang($idf, $number = null) {
array_shift($args);
$format = str_replace("%d", "%s", $translation);
if ($format != $translation) {
$args[0] = number_format($number, 0, ".", lang(','));
$args[0] = format_number($number);
}
return vsprintf($format, $args);
}

View file

@ -177,6 +177,7 @@ $translations = array(
'Data Free' => 'المساحة الحرة',
'Rows' => 'الأسطر',
',' => ',',
'0123456789' => '٠١٢٣٤٥٦٧٨٩',
'Analyze' => 'تحليل',
'Optimize' => 'تحسين',
'Check' => 'فحص',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'টেবিল ছাঁটাই করা হয়েছে',
'Rows' => 'সারি',
',' => ',',
'0123456789' => '০১২৩৪৫৬৭৮৯',
'Tables have been moved.' => 'টেবিল স্থানান্তর করা হয়েছে।',
'Move to other database' => 'অন্য ডাটাবেজে স্থানান্তর করো',
'Move' => 'স্থানান্তর করো',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'S\'han escapçat les taules.',
'Rows' => 'Files',
',' => ',',
'0123456789' => '0123456789',
'Tables have been moved.' => 'S\'han desplaçat les taules.',
'Move to other database' => 'Desplaça a una altra base de dades',
'Move' => 'Desplaça',

View file

@ -95,6 +95,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Úložiště',
'Collation' => 'Porovnávání',
'Data Length' => 'Velikost dat',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'Tabellen sind entleert worden (truncate).',
'Rows' => 'Datensätze',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Tabellen verschoben.',
'Move to other database' => 'In andere Datenbank verschieben',
'Move' => 'Verschieben',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'Tablas vaciadas (truncate).',
'Rows' => 'Registros',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Se movieron las tablas.',
'Move to other database' => 'Mover a otra base de datos',
'Move' => 'Mover',

View file

@ -179,6 +179,7 @@ $translations = array(
'Data Free' => 'Vaba ruumi',
'Rows' => 'Ridu',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => 'Analüüsi',
'Optimize' => 'Optimeeri',
'Check' => 'Kontrolli',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '۰۱۲۳۴۵۶۷۸۹',
'Engine' => 'موتور',
'Collation' => 'تطبیق',
'Data Length' => 'طول داده',

View file

@ -177,6 +177,7 @@ $translations = array(
'Data Free' => 'Espace inutilisé',
'Rows' => 'Lignes',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => 'Analyser',
'Optimize' => 'Optimiser',
'Check' => 'Vérifier',
@ -192,7 +193,7 @@ $translations = array(
'Partitions' => 'Partitions',
'Partition name' => 'Nom de la partition',
'Values' => 'Valeurs',
'%d row(s) have been imported.' => array('%d ligne a été importée.','%d lignes ont été importées.'),
'%d row(s) have been imported.' => array('%d ligne a été importée.', '%d lignes ont été importées.'),
'anywhere' => 'n\'importe où',
'Import' => 'Importer',
'Stop on error' => 'Arrêter en cas d\'erreur',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'A tábla felszabadítva.',
'Rows' => 'Oszlop',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Táblák áthelyezve.',
'Move to other database' => 'Áthelyezés másik adatbázisba',
'Move' => 'Áthelyez',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => '.',
'0123456789' => '0123456789',
'Engine' => 'Mesin',
'Collation' => 'Kolasi',
'Data Length' => 'Panjang Data',

View file

@ -179,6 +179,7 @@ $translations = array(
'Data Free' => 'Dati liberi',
'Rows' => 'Righe',
',' => '.',
'0123456789' => '0123456789',
'Analyze' => 'Analizza',
'Optimize' => 'Ottimizza',
'Check' => 'Controlla',

View file

@ -175,6 +175,7 @@ $translations = array(
'Data Free' => '空き',
'Rows' => '行数',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => '分析',
'Optimize' => '最適化',
'Check' => 'チェック',

View file

@ -175,6 +175,7 @@ $translations = array(
'Data Free' => '여유',
'Rows' => '행',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => '분석',
'Optimize' => '최적화',
'Check' => '확인',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Variklis',
'Collation' => 'Lyginimas',
'Data Length' => 'Duomenų ilgis',

View file

@ -180,6 +180,7 @@ $translations = array(
'Data Free' => 'Data Vrij',
'Rows' => 'Rijen',
',' => '.',
'0123456789' => '0123456789',
'Analyze' => 'Analyseer',
'Optimize' => 'Optimaliseer',
'Check' => 'Controleer',

View file

@ -80,6 +80,7 @@ $translations = array(
'Database schema' => 'Databaseskjema',
'Permanent link' => 'Permanent lenke',
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Motor',
'Collation' => 'Tekstsortering',
'Data Length' => 'Datalengde',

View file

@ -95,6 +95,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Składowanie',
'Collation' => 'Porównywanie znaków',
'Data Length' => 'Rozmiar danych',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'As Tabelas foram truncadas.',
'Rows' => 'Registros',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'As Tabelas foram movidas.',
'Move to other database' => 'Mover para outra Base de dados',
'Move' => 'Mover',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'Tabelas truncadas (truncate).',
'Rows' => 'Registos',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'As Tabelas foram movidas.',
'Move to other database' => 'Mover outra Base de dados',
'Move' => 'Mover',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'Tabelele au fost curățate.',
'Rows' => 'Înscrieri',
',' => ',',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Tabelele au fost mutate.',
'Move to other database' => 'Mută în altă bază de date',
'Move' => 'Mută',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'Таблицы были очищены.',
'Rows' => 'Строк',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Таблицы были перемещены.',
'Move to other database' => 'Переместить в другую базу данных',
'Move' => 'Переместить',

View file

@ -180,6 +180,7 @@ $translations = array(
'Data Free' => 'Voľné miesto',
'Rows' => 'Riadky',
',' => ' ',
'0123456789' => '0123456789',
'Analyze' => 'Analyzovať',
'Optimize' => 'Optimalizovať',
'Check' => 'Skontrolovať',

View file

@ -89,6 +89,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Pogon',
'Collation' => 'Zbiranje',
'Data Length' => 'Velikost podatkov',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ',',
'0123456789' => '0123456789',
'Engine' => 'Механизам',
'Collation' => 'Сравњивање',
'Data Length' => 'Дужина података',

View file

@ -176,6 +176,7 @@ $translations = array(
'Tables have been truncated.' => 'அட்ட‌வ‌ணை குறைக்க‌ப்ப‌ட்ட‌து (truncated).',
'Rows' => 'வ‌ரிசைக‌ள்',
',' => ',',
'0123456789' => '0123456789',
'Tables have been moved.' => 'அட்ட‌வ‌ணை ந‌க‌ர்த்த‌ப்ப‌ட்ட‌து.',
'Move to other database' => 'ம‌ற்ற‌ த‌க‌வ‌ல் தள‌த்திற்க்கு ந‌க‌ர்த்து',
'Move' => 'ந‌க‌ர்த்து',

View file

@ -179,6 +179,7 @@ $translations = array(
'Tables have been truncated.' => 'เคลียร์ตารางแล้ว (truncate).',
'Rows' => 'แถว',
',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'ตารางถูกย้ายแล้ว.',
'Move to other database' => 'ย้ายไปยังฐานข้อมูลอื่น',
'Move' => 'ย้าย',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Motor',
'Collation' => 'Karşılaştırma',
'Data Length' => 'Veri Uzunluğu',

View file

@ -93,6 +93,7 @@ $translations = array(
// thousands separator - must contain single byte
',' => ' ',
'0123456789' => '0123456789',
'Engine' => 'Рушій',
'Collation' => 'Співставлення',
'Data Length' => 'Об\'єм даних',

View file

@ -94,7 +94,8 @@ $translations = array(
'Permanent link' => 'xx',
// thousands separator - must contain single byte
',' => 'xx',
',' => 'x',
'0123456789' => 'xxxxxxxxxx',
'Engine' => 'xx',
'Collation' => 'xx',
'Data Length' => 'xx',

View file

@ -174,6 +174,7 @@ $translations = array(
'Data Free' => '資料空閒',
'Rows' => '行數',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => '分析',
'Optimize' => '最佳化',
'Check' => '檢查',

View file

@ -176,6 +176,7 @@ $translations = array(
'Data Free' => '数据空闲',
'Rows' => '行数',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => '分析',
'Optimize' => '优化',
'Check' => '检查',

View file

@ -12,7 +12,7 @@ if ($_GET["script"] == "db") {
}
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
if ($table_status[$key] != "") {
$val = number_format($table_status[$key], 0, '.', lang(','));
$val = format_number($table_status[$key]);
json_row("$key-$id", ($key == "Rows" && $val && $table_status["Engine"] == ($sql == "pgsql" ? "table" : "InnoDB")
? "~ $val"
: $val
@ -28,7 +28,7 @@ if ($_GET["script"] == "db") {
}
}
foreach ($sums as $key => $val) {
json_row("sum-$key", number_format($val, 0, '.', lang(',')));
json_row("sum-$key", format_number($val));
}
json_row("");

View file

@ -12,6 +12,7 @@ MySQL 5.6.5+: Support ON UPDATE on datatime column
SQLite: Support UPDATE OF triggers
SQLite: Display auto-created unique indexes, bug since Adminer 3.5.0
Editor: Fix login() method, bug since Adminer 4.0.0
Translate numbers in ar, bn, fa
Adminer 4.0.3 (released 2014-02-01)
MongoDB: insert, truncate, indexes

View file

@ -70,7 +70,7 @@ function lang(\$translation, \$number = null) {
$translation = $translation[$pos];
}
$translation = str_replace("%d", "%s", $translation);
$number = number_format($number, 0, ".", lang(\',\'));
$number = format_number($number);
return sprintf($translation, $number);
}
';

View file

@ -15,7 +15,7 @@ if ($adminer->homepage()) {
if (isset($row["Engine"]) && $name != "") {
echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
echo "<th><a href='" . h(ME) . 'select=' . urlencode($table) . "'>$name</a>";
$val = number_format($row["Rows"], 0, '.', lang(','));
$val = format_number($row["Rows"]);
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
}
}