Skip to content

Commit

Permalink
Added translate for empty data messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mesour committed Mar 8, 2016
1 parent 20b23db commit f2fce2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions docs/localisation.md
Expand Up @@ -6,10 +6,12 @@ This component also uses this next translation keys:
- [mesour/pager](https://github.com/mesour/pager/blob/master/docs/localisation.md)
- [mesour/selection](https://github.com/mesour/selection/blob/master/docs/localisation.md)

| Key | Description |
|--------------------|------------------------------------------------------------------------|
| Export | Used as text in main button for export dropdown |
| Export filtered | Used in export dropdown |
| Export all | Used in export dropdown |
| Selected | Used as text in main button for selection dropdown |
| Export to CSV | Used in selection dropdown |
| Key | Description |
|---------------------------------------------------|---------------------------------------------------------|
| Export | Used as text in main button for export dropdown |
| Export filtered | Used in export dropdown |
| Export all | Used in export dropdown |
| Selected | Used as text in main button for selection dropdown |
| Export to CSV | Used in selection dropdown |
| Nothing to display. | Used if has no data |
| Nothing found. Please change the filter criteria. | Used if has no data after filtering |
4 changes: 2 additions & 2 deletions src/Mesour/DataGrid/BaseGrid.php
Expand Up @@ -385,9 +385,9 @@ private function createTable($data, $rawData)
$body = $renderer->createBody();

if ($this->getSource()->getTotalCount() === 0) {
$this->addRow($body, count($columns), [], true, $this->emptyText);
$this->addRow($body, count($columns), [], true, $this->getTranslator()->translate($this->emptyText));
} else if ($this->count === 0) {
$this->addRow($body, count($columns), [], true, $this->emptyFilterText);
$this->addRow($body, count($columns), [], true, $this->getTranslator()->translate($this->emptyFilterText));
} else {
foreach ($data as $key => $rowData) {
$this->addRow($body, $rowData, $rawData[$key]);
Expand Down

0 comments on commit f2fce2f

Please sign in to comment.