Skip to content

Commit

Permalink
var renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Sep 18, 2020
1 parent 058e79f commit f7f2b27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Console/Commands/AddTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ public function handle()
{
foreach ($this->getFiles() as $file) {
$targetDirectory = resource_path('lang');
$mainFile = $targetDirectory.'/'.$file->getBasename();
$targetPath = $targetDirectory.'/'.$file->getBasename();
if ($this->files->missing($targetDirectory)) {
$this->files->makeDirectory($targetDirectory);
}
if ($this->files->missing($mainFile)) {
$this->files->copy($file->getPathname(), $mainFile);
$this->info($mainFile.' created.');
if ($this->files->missing($targetPath)) {
$this->files->copy($file->getPathname(), $targetPath);
$this->info($targetPath.' created.');
continue;
}

$existingTranslations = $this->getTranslations($mainFile);
$existingTranslations = $this->getTranslations($targetPath);
$newTranslations = $this->getTranslations($file);

if ($this->option('force')) {
Expand All @@ -43,9 +43,9 @@ public function handle()
}
ksort($translations, SORT_STRING | SORT_FLAG_CASE);

$this->put($mainFile, $translations);
$this->put($targetPath, $translations);

$this->info(count($translations) - count($existingTranslations).' translations added in '.$mainFile.'.');
$this->info(count($translations) - count($existingTranslations).' translations added in '.$targetPath.'.');
}
}
}

0 comments on commit f7f2b27

Please sign in to comment.