Skip to content

Commit

Permalink
Copy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
subotkevic committed Oct 17, 2018
1 parent ebd596a commit 3967d58
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Command/TranslationHelperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,27 @@ public function handle()

foreach ($translationFiles as $file) {
$translationData = $this->getAlreadyTranslatedKeys($file);
$this->line("lang " . str_replace('.json', '', basename($file)));
$this->line("Language: " . str_replace('.json', '', basename($file)));
$added = [];

foreach ($translationKeys as $key) {
if (!isset($translationData[$key])) {
$this->warn(" - Added {$key}");
$this->warn(" - Added: {$key}");
$translationData[$key] = '';
$added[] = $key;
}
}

if ($added) {
$this->line("Updating translation file...");

$this->writeNewTranslationFile($file, $translationData);
$this->info("Done!");

$this->info("Translation file have been updated!");
} else {
$this->warn("Nothing new found for this language.");
}

$this->line("");
}
}
Expand Down

0 comments on commit 3967d58

Please sign in to comment.