Use ngettext for number of inserted rows.
This commit is contained in:
@@ -303,6 +303,25 @@ class PMA_Message
|
|||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get PMA_Message for number of inserted rows
|
||||||
|
*
|
||||||
|
* shorthand for getting a customized message
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @uses PMA_Message as returned object
|
||||||
|
* @uses PMA_Message::success()
|
||||||
|
* @uses PMA_Message::addParam()
|
||||||
|
* @param integer $rows Number of rows
|
||||||
|
* @return PMA_Message
|
||||||
|
*/
|
||||||
|
static public function inserted_rows($rows)
|
||||||
|
{
|
||||||
|
$message = PMA_Message::success(_ngettext('%1$d row inserted.', '%1$d rows inserted.', $rows));
|
||||||
|
$message->addParam($rows);
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get PMA_Message of type error with custom content
|
* get PMA_Message of type error with custom content
|
||||||
*
|
*
|
||||||
|
@@ -829,7 +829,6 @@ $strRoutineReturnType = __('Return type');
|
|||||||
$strRoutines = __('Routines');
|
$strRoutines = __('Routines');
|
||||||
$strRowLength = __('Row length');
|
$strRowLength = __('Row length');
|
||||||
$strRowsFrom = __('row(s) starting from record #');
|
$strRowsFrom = __('row(s) starting from record #');
|
||||||
$strRowsInserted = __('%1$d row(s) inserted.');
|
|
||||||
$strRowSize = __(' Row size ');
|
$strRowSize = __(' Row size ');
|
||||||
$strRowsModeFlippedHorizontal = __('horizontal (rotated headers)');
|
$strRowsModeFlippedHorizontal = __('horizontal (rotated headers)');
|
||||||
$strRowsModeHorizontal = __('horizontal');
|
$strRowsModeHorizontal = __('horizontal');
|
||||||
|
3
sql.php
3
sql.php
@@ -492,8 +492,7 @@ if (0 == $num_rows || $is_affected) {
|
|||||||
/* For replace we get DELETED + INSERTED row count, so we have to call it affected */
|
/* For replace we get DELETED + INSERTED row count, so we have to call it affected */
|
||||||
$message = PMA_Message::affected_rows($num_rows);
|
$message = PMA_Message::affected_rows($num_rows);
|
||||||
} else {
|
} else {
|
||||||
$message = PMA_Message::success('strRowsInserted');
|
$message = PMA_Message::inserted_rows($num_rows);
|
||||||
$message->addParam($num_rows);
|
|
||||||
}
|
}
|
||||||
$insert_id = PMA_DBI_insert_id();
|
$insert_id = PMA_DBI_insert_id();
|
||||||
if ($insert_id != 0) {
|
if ($insert_id != 0) {
|
||||||
|
@@ -400,8 +400,7 @@ foreach ($query as $single_query) {
|
|||||||
unset($single_query, $query);
|
unset($single_query, $query);
|
||||||
|
|
||||||
if ($is_insert && count($value_sets) > 0) {
|
if ($is_insert && count($value_sets) > 0) {
|
||||||
$message = PMA_Message::success('strRowsInserted');
|
$message = PMA_Message::inserted_rows($total_affected_rows);
|
||||||
$message->addParam($total_affected_rows);
|
|
||||||
} else {
|
} else {
|
||||||
$message = PMA_Message::affected_rows($total_affected_rows);
|
$message = PMA_Message::affected_rows($total_affected_rows);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user