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) { foreach (table_status() as $table_status) {
$return += $table_status["Data_length"] + $table_status["Index_length"]; $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>"); 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 /** Generate friendly URL
* @param string * @param string
* @return string * @return string

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -177,6 +177,7 @@ $translations = array(
'Data Free' => 'Espace inutilisé', 'Data Free' => 'Espace inutilisé',
'Rows' => 'Lignes', 'Rows' => 'Lignes',
',' => ',', ',' => ',',
'0123456789' => '0123456789',
'Analyze' => 'Analyser', 'Analyze' => 'Analyser',
'Optimize' => 'Optimiser', 'Optimize' => 'Optimiser',
'Check' => 'Vérifier', 'Check' => 'Vérifier',
@ -192,7 +193,7 @@ $translations = array(
'Partitions' => 'Partitions', 'Partitions' => 'Partitions',
'Partition name' => 'Nom de la partition', 'Partition name' => 'Nom de la partition',
'Values' => 'Valeurs', '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ù', 'anywhere' => 'n\'importe où',
'Import' => 'Importer', 'Import' => 'Importer',
'Stop on error' => 'Arrêter en cas d\'erreur', '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.', 'Tables have been truncated.' => 'A tábla felszabadítva.',
'Rows' => 'Oszlop', 'Rows' => 'Oszlop',
',' => ' ', ',' => ' ',
'0123456789' => '0123456789',
'Tables have been moved.' => 'Táblák áthelyezve.', 'Tables have been moved.' => 'Táblák áthelyezve.',
'Move to other database' => 'Áthelyezés másik adatbázisba', 'Move to other database' => 'Áthelyezés másik adatbázisba',
'Move' => 'Áthelyez', 'Move' => 'Áthelyez',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,6 +12,7 @@ MySQL 5.6.5+: Support ON UPDATE on datatime column
SQLite: Support UPDATE OF triggers SQLite: Support UPDATE OF triggers
SQLite: Display auto-created unique indexes, bug since Adminer 3.5.0 SQLite: Display auto-created unique indexes, bug since Adminer 3.5.0
Editor: Fix login() method, bug since Adminer 4.0.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) Adminer 4.0.3 (released 2014-02-01)
MongoDB: insert, truncate, indexes MongoDB: insert, truncate, indexes

View file

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

View file

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