@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate; |
| 4 | 4 | |
| 5 | +use Ben182\AutoTranslate\Translators\TranslatorInterface; |
|
| 5 | 6 | use Illuminate\Support\Arr; |
| 6 | 7 | use Themsaid\Langman\Manager as Langman; |
| 7 | -use Ben182\AutoTranslate\Translators\TranslatorInterface; |
|
| 8 | 8 | |
| 9 | 9 | class AutoTranslate |
| 10 | 10 | { |
@@ -55,6 +55,9 @@ |
||
| 55 | 55 | return collect($dottedSource)->only($diff); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | + /** |
|
| 59 | + * @param \Closure $callbackAfterEachTranslation |
|
| 60 | + */ |
|
| 58 | 61 | public function translate(string $targetLanguage, $data, $callbackAfterEachTranslation = null) |
| 59 | 62 | { |
| 60 | 63 | $this->translator->setTarget($targetLanguage); |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\Commands; |
| 4 | 4 | |
| 5 | +use Ben182\AutoTranslate\AutoTranslate; |
|
| 6 | +use Illuminate\Console\Command; |
|
| 5 | 7 | use Illuminate\Support\Arr; |
| 6 | 8 | use Illuminate\Support\Str; |
| 7 | -use Illuminate\Console\Command; |
|
| 8 | -use Ben182\AutoTranslate\AutoTranslate; |
|
| 9 | 9 | |
| 10 | 10 | class AllCommand extends Command |
| 11 | 11 | { |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\Commands; |
| 4 | 4 | |
| 5 | +use Ben182\AutoTranslate\AutoTranslate; |
|
| 6 | +use Illuminate\Console\Command; |
|
| 5 | 7 | use Illuminate\Support\Arr; |
| 6 | 8 | use Illuminate\Support\Str; |
| 7 | -use Illuminate\Console\Command; |
|
| 8 | -use Ben182\AutoTranslate\AutoTranslate; |
|
| 9 | 9 | |
| 10 | 10 | class MissingCommand extends Command |
| 11 | 11 | { |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\Translators; |
| 4 | 4 | |
| 5 | +use Ben182\AutoTranslate\Exceptions\LanguageCodeNotExist; |
|
| 5 | 6 | use Scn\DeeplApiConnector\DeeplClient; |
| 6 | -use Scn\DeeplApiConnector\Model\TranslationConfig; |
|
| 7 | 7 | use Scn\DeeplApiConnector\Exception\RequestException; |
| 8 | -use Ben182\AutoTranslate\Exceptions\LanguageCodeNotExist; |
|
| 8 | +use Scn\DeeplApiConnector\Model\TranslationConfig; |
|
| 9 | 9 | |
| 10 | 10 | class DeeplTranslator implements TranslatorInterface |
| 11 | 11 | { |