Skip to content

Commit

Permalink
Fixing the Log Levels translations
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Jul 19, 2018
1 parent b40ad66 commit 8490d1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/Tables/StatsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ protected function prepareFooter(array $data)
*
* @return \Illuminate\Support\Collection
*/
public function totals($locale = null)
public function totals()
{
$this->setLocale($locale);

$totals = Collection::make();

foreach (Arr::except($this->footer(), 'all') as $level => $count) {
Expand Down
4 changes: 1 addition & 3 deletions src/Utilities/LogLevels.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ public static function all($flip = false)
*/
public function get($key, $locale = null)
{
$this->setLocale($locale);

return $this->translator->get("log-viewer::levels.$key", [], $this->getLocale());
return $this->translator->get("log-viewer::levels.$key", [], $locale ?: $this->getLocale());
}
}
8 changes: 2 additions & 6 deletions tests/Utilities/LogLevelsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,8 @@ public function it_can_translate_levels_automatically()
);

$this->assertTranslatedLevels(
$this->app->getLocale(),
$this->levels->names('auto')
);

$this->assertTranslatedLevels(
$locale, $this->levels->names($locale)
$locale,
$this->levels->names($locale)
);
}
}
Expand Down

0 comments on commit 8490d1b

Please sign in to comment.