From 3f787161bca9ee1107020b5cfea38a4a96b38ed1 Mon Sep 17 00:00:00 2001 From: Muhittin Tan Date: Tue, 2 Apr 2019 16:58:59 +0300 Subject: [PATCH] make translate files commands public --- src/commands/TranslateFilesCommand.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/commands/TranslateFilesCommand.php b/src/commands/TranslateFilesCommand.php index e4b2e84..fc58399 100644 --- a/src/commands/TranslateFilesCommand.php +++ b/src/commands/TranslateFilesCommand.php @@ -43,12 +43,12 @@ public function __construct($base_locale = 'en', $locales = 'tr,it', $target_fil { parent::__construct(); $this->base_locale = $base_locale; - $this->locales = $locales; - $this->target_files = $target_files; + $this->locales = array_filter(explode(",", $locales)); + $this->target_files = array_filter(explode(",", $target_files)); $this->force = $force; $this->json = $json; $this->verbose = $verbose; - $this->excluded_files = $excluded_files; + $this->excluded_files = array_filter(explode(",", $excluded_files)); } /** @@ -180,7 +180,7 @@ private static function translate_via_api_key($base_locale, $locale, $text){ * @param $locale * @throws \Exception */ - private function translate_php_array_files($locale) + public function translate_php_array_files($locale) { $files = preg_grep('/^([^.])/', scandir(resource_path('lang/' . $this->base_locale))); @@ -286,9 +286,11 @@ private function explore_strings(){ /** * @param $locale + * @param $stringKeys + * @throws \ErrorException * @throws \Exception */ - private function translate_json_array_file($locale,$stringKeys) + public function translate_json_array_file($locale,$stringKeys) { $new_lang = []; $json_existing_translations = [];