From 9a780799d1f8a1633b56e51c600ce076e6f0a4f1 Mon Sep 17 00:00:00 2001 From: neoteknic Date: Fri, 15 Oct 2021 08:18:06 +0200 Subject: [PATCH] Update TranslateFilesCommand.php (#42) * Update TranslateFilesCommand.php allow to add default_target_locales in config * Update laravel_google_translate.php --- src/Commands/TranslateFilesCommand.php | 2 +- src/config/laravel_google_translate.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Commands/TranslateFilesCommand.php b/src/Commands/TranslateFilesCommand.php index 13a7b25..28a3d6f 100644 --- a/src/Commands/TranslateFilesCommand.php +++ b/src/Commands/TranslateFilesCommand.php @@ -62,7 +62,7 @@ public function handle() { //Collect input $this->base_locale = $this->ask('What is base locale?', config('app.locale', 'en')); - $this->locales = array_filter(explode(",", $this->ask('What are the target locales? Comma seperate each lang key', 'tr,it'))); + $this->locales = array_filter(explode(",", $this->ask('What are the target locales? Comma seperate each lang key', config('laravel_google_translate.default_target_locales','tr,it')))); $should_force = $this->choice('Force overwrite existing translations?', ['No', 'Yes'], 'No'); $this->force = false; if ($should_force === 'Yes') { diff --git a/src/config/laravel_google_translate.php b/src/config/laravel_google_translate.php index 95334c5..e0b2d10 100644 --- a/src/config/laravel_google_translate.php +++ b/src/config/laravel_google_translate.php @@ -8,6 +8,7 @@ 'no_requests_per_batch' => env('NO_REQUESTS_PER_BATCH', 5), 'sleep_time_between_batches' => env('SLEEP_TIME_BETWEEN_BATCHES', 1) ], + 'default_target_locales'=>'tr,it', 'trans_functions' => [ 'trans', 'trans_choice',