@@ -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 | { |
@@ -15,6 +15,9 @@ discard block |
||
| 15 | 15 | $this->translator->setSource(config('auto-translate.source_language')); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | + /** |
|
| 19 | + * @param \Closure $callbackAfterEachTranslation |
|
| 20 | + */ |
|
| 18 | 21 | public function translateAll(array $targetLanguages, $callbackAfterEachTranslation = null) |
| 19 | 22 | { |
| 20 | 23 | $sourceTranslations = $this->getSourceTranslations(); |
@@ -30,6 +33,9 @@ discard block |
||
| 30 | 33 | } |
| 31 | 34 | } |
| 32 | 35 | |
| 36 | + /** |
|
| 37 | + * @param \Closure $callbackAfterEachTranslation |
|
| 38 | + */ |
|
| 33 | 39 | public function translateMissing(array $targetLanguages, $callbackAfterEachTranslation = null) |
| 34 | 40 | { |
| 35 | 41 | foreach ($targetLanguages as $targetLanguage) { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Arr; |
|
| 6 | 5 | use Ben182\AutoTranslate\Translators\TranslatorInterface; |
| 7 | 6 | |
| 8 | 7 | abstract class AutoTranslate |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate; |
| 4 | 4 | |
| 5 | -use Themsaid\Langman\Manager; |
|
| 6 | -use Illuminate\Support\ServiceProvider; |
|
| 7 | 5 | use Ben182\AutoTranslate\Commands\AllCommand; |
| 8 | 6 | use Ben182\AutoTranslate\Commands\MissingCommand; |
| 9 | 7 | use Ben182\AutoTranslate\Translators\TranslatorInterface; |
| 8 | +use Illuminate\Support\ServiceProvider; |
|
| 9 | +use Themsaid\Langman\Manager; |
|
| 10 | 10 | |
| 11 | 11 | class AutoTranslateServiceProvider extends ServiceProvider |
| 12 | 12 | { |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Ben182\AutoTranslate\AutoTranslators; |
| 4 | 4 | |
| 5 | 5 | use Ben182\AutoTranslate\AutoTranslate; |
| 6 | -use Ben182\AutoTranslate\Translators\TranslatorInterface; |
|
| 7 | 6 | |
| 8 | 7 | class JsonTranslator extends AutoTranslate |
| 9 | 8 | { |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\AutoTranslators; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Arr; |
|
| 6 | -use Themsaid\Langman\Manager as Langman; |
|
| 7 | 5 | use Ben182\AutoTranslate\AutoTranslate; |
| 8 | 6 | use Ben182\AutoTranslate\Translators\TranslatorInterface; |
| 7 | +use Illuminate\Support\Arr; |
|
| 8 | +use Themsaid\Langman\Manager as Langman; |
|
| 9 | 9 | |
| 10 | 10 | class PhpTranslator extends AutoTranslate |
| 11 | 11 | { |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\Commands; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Arr; |
|
| 6 | -use Illuminate\Support\Str; |
|
| 7 | -use Illuminate\Console\Command; |
|
| 8 | 5 | use Ben182\AutoTranslate\AutoTranslators\JsonTranslator; |
| 9 | 6 | use Ben182\AutoTranslate\AutoTranslators\PhpTranslator; |
| 7 | +use Illuminate\Console\Command; |
|
| 8 | +use Illuminate\Support\Arr; |
|
| 9 | +use Illuminate\Support\Str; |
|
| 10 | 10 | |
| 11 | 11 | class AllCommand extends Command |
| 12 | 12 | { |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ben182\AutoTranslate\Commands; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Arr; |
|
| 6 | -use Illuminate\Support\Str; |
|
| 7 | -use Illuminate\Console\Command; |
|
| 8 | 5 | use Ben182\AutoTranslate\AutoTranslators\JsonTranslator; |
| 9 | 6 | use Ben182\AutoTranslate\AutoTranslators\PhpTranslator; |
| 7 | +use Illuminate\Console\Command; |
|
| 8 | +use Illuminate\Support\Arr; |
|
| 9 | +use Illuminate\Support\Str; |
|
| 10 | 10 | |
| 11 | 11 | class MissingCommand extends Command |
| 12 | 12 | { |