diff --git a/config/translation-linter.php b/config/translation-linter.php index b7203b8..bd7b2a7 100644 --- a/config/translation-linter.php +++ b/config/translation-linter.php @@ -57,17 +57,6 @@ 'Lang::has', ], - /* - |-------------------------------------------------------------------------- - | Language Locales - |-------------------------------------------------------------------------- - | - | The following array contains the "locales" to use when finding all of - | your registered language files. - | - */ - 'locales' => [env('LOCALE_DEFAULT', 'en')], - /* |-------------------------------------------------------------------------- | Language File Readers @@ -130,6 +119,17 @@ | */ 'filters' => [], + + /* + |-------------------------------------------------------------------------- + | Language Locales + |-------------------------------------------------------------------------- + | + | The following array contains the "locales" to use when finding all of + | your registered language files. + | + */ + 'locales' => [env('LOCALE_DEFAULT', 'en')], ], 'unused' => [ @@ -181,5 +181,16 @@ \Fidum\LaravelTranslationLinter\Filters\IgnoreNamespacedKeysFilter::class, \Fidum\LaravelTranslationLinter\Filters\IgnoreVendorKeysFilter::class, ], + + /* + |-------------------------------------------------------------------------- + | Language Locales + |-------------------------------------------------------------------------- + | + | The following array contains the "locales" to use when finding all of + | your registered language files. + | + */ + 'locales' => [env('LOCALE_DEFAULT', 'en')], ], ]; diff --git a/src/LaravelTranslationLinterServiceProvider.php b/src/LaravelTranslationLinterServiceProvider.php index d527638..b05a423 100644 --- a/src/LaravelTranslationLinterServiceProvider.php +++ b/src/LaravelTranslationLinterServiceProvider.php @@ -126,7 +126,7 @@ public function registeringPackage() $this->app->when(MissingTranslationLinter::class) ->needs('$locales') - ->giveConfig('translation-linter.lang.locales'); + ->giveConfig('translation-linter.missing.locales'); $this->app->bind(ResultObjectCollectionContract::class, ResultObjectCollection::class); @@ -154,7 +154,7 @@ public function registeringPackage() $this->app->when(UnusedTranslationLinter::class) ->needs('$locales') - ->giveConfig('translation-linter.lang.locales'); + ->giveConfig('translation-linter.unused.locales'); } public function provides() diff --git a/tests/Commands/MissingCommandTest.php b/tests/Commands/MissingCommandTest.php index 499c4bf..1ba65cb 100644 --- a/tests/Commands/MissingCommandTest.php +++ b/tests/Commands/MissingCommandTest.php @@ -53,7 +53,7 @@ }); it('errors with multiple locales', function () { - config()->set('translation-linter.lang.locales', ['en', 'de']); + config()->set('translation-linter.missing.locales', ['en', 'de']); $firstFile = workbench_path('app/ExampleJson.php'); withoutMockingConsoleOutput(); @@ -64,7 +64,7 @@ }); it('generates baseline file then successfully ignores baseline keys', function () { - config()->set('translation-linter.lang.locales', ['en', 'de']); + config()->set('translation-linter.missing.locales', ['en', 'de']); withoutMockingConsoleOutput(); expect(artisan('translation:missing --generate-baseline')) @@ -84,7 +84,7 @@ }); it('outputs success message when no missing translations found', function () { - config()->set('translation-linter.lang.locales', []); + config()->set('translation-linter.missing.locales', []); withoutMockingConsoleOutput(); expect(artisan('translation:missing')) ->toBe(0) diff --git a/tests/Commands/UnusedCommandTest.php b/tests/Commands/UnusedCommandTest.php index d4006a3..b3ce711 100644 --- a/tests/Commands/UnusedCommandTest.php +++ b/tests/Commands/UnusedCommandTest.php @@ -51,7 +51,7 @@ }); it('errors with multiple locales', function () { - config()->set('translation-linter.lang.locales', ['en', 'de']); + config()->set('translation-linter.unused.locales', ['en', 'de']); withoutMockingConsoleOutput(); expect(artisan('translation:unused')) ->toBe(1) @@ -60,7 +60,7 @@ }); it('errors with multiple locales and no filters', function () { - config()->set('translation-linter.lang.locales', ['en', 'de']); + config()->set('translation-linter.unused.locales', ['en', 'de']); config()->set('translation-linter.unused.filters', []); withoutMockingConsoleOutput(); @@ -71,7 +71,7 @@ }); it('generates baseline file then successfully ignores baseline keys', function () { - config()->set('translation-linter.lang.locales', ['en', 'de']); + config()->set('translation-linter.unused.locales', ['en', 'de']); config()->set('translation-linter.unused.filters', [IgnoreKeysFromUnusedBaselineFileFilter::class]); withoutMockingConsoleOutput(); @@ -92,7 +92,7 @@ }); it('outputs success message when no unused translations found', function () { - config()->set('translation-linter.lang.locales', []); + config()->set('translation-linter.unused.locales', []); withoutMockingConsoleOutput(); expect(artisan('translation:unused')) ->toBe(0)