From 8490d1bd349e16a3a8af2c56457455f94736734c Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 19 Jul 2018 17:23:58 +0100 Subject: [PATCH] Fixing the Log Levels translations --- src/Tables/StatsTable.php | 4 +--- src/Utilities/LogLevels.php | 4 +--- tests/Utilities/LogLevelsTest.php | 8 ++------ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Tables/StatsTable.php b/src/Tables/StatsTable.php index c5c29e0e..0c2a79ff 100644 --- a/src/Tables/StatsTable.php +++ b/src/Tables/StatsTable.php @@ -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) { diff --git a/src/Utilities/LogLevels.php b/src/Utilities/LogLevels.php index 3f8ee5ad..27c07b38 100644 --- a/src/Utilities/LogLevels.php +++ b/src/Utilities/LogLevels.php @@ -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()); } } diff --git a/tests/Utilities/LogLevelsTest.php b/tests/Utilities/LogLevelsTest.php index dc985f74..bc717ed2 100644 --- a/tests/Utilities/LogLevelsTest.php +++ b/tests/Utilities/LogLevelsTest.php @@ -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) ); } }