Skip to content

Commit

Permalink
Merge pull request ARCANEDEV#223 from ARCANEDEV/patch-1
Browse files Browse the repository at this point in the history
Fixing the Log Levels translations
  • Loading branch information
arcanedev-maroc authored Jul 19, 2018
2 parents b40ad66 + 8490d1b commit 1b15cb8
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 1b15cb8

Please sign in to comment.