From 6df68b00dba352629c982139c147d6229d3576c9 Mon Sep 17 00:00:00 2001 From: Nicolae Buta <40632896+ButaNicolae@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:08:46 +0300 Subject: [PATCH] Update TranslationScanner.php Capability to get lang files from laravel modules if have modules not only from the root of the laravel project. --- src/Helpers/TranslationScanner.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Helpers/TranslationScanner.php b/src/Helpers/TranslationScanner.php index 9679c16..0999ee5 100644 --- a/src/Helpers/TranslationScanner.php +++ b/src/Helpers/TranslationScanner.php @@ -18,8 +18,14 @@ class TranslationScanner */ public static function scan(): array { + $directories = File::glob(base_path('Modules/*/lang/')); + $files = File::allFiles(lang_path()); + if (!empty($directories)) { + $files = array_merge($files, File::allFiles($directories)); + } + // Loop through all groups foreach ($files as $file) { // Skip any other files than .php language files e.g. JSON files