Skip to content

Commit

Permalink
Fix for missing translations in the import (#38)
Browse files Browse the repository at this point in the history
* Translation export now creates the full path before writing + Translation import's setMissingTranslations accepts an assoc array to set default trans values if missing for certain locale

* Fix for missing translations in the import

Co-authored-by: Christian <[email protected]>
  • Loading branch information
alorman-omatech and Christian authored Jul 20, 2021
1 parent 3f76a72 commit 5dae65b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/Repositories/Translation/ImportTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function make(string $path, string $locale = '')
foreach ($translations as $translation) {
$current = $this->findTranslation->find(['key' => $translation['key']]);
$translation['id'] = $current['id'] ?? null;
$translation = $this->setMissingTranslations($translation, $current['value']);
$translation = $this->setMissingTranslations($translation, optional($current)['value'] ?? []);
$this->saveTranslation->make($translation);
}
}
Expand Down

0 comments on commit 5dae65b

Please sign in to comment.