Skip to content

Commit

Permalink
ensure directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
bambamboole committed Feb 21, 2024
1 parent 1cb65b5 commit f042ee4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TranslationDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public function dump(array $translationKeys): void
$result = $this->transformDottedStringsToArray($dottedStrings);

foreach ($result as $key => $value) {
$file = $this->languageFilePath."/{$this->locale}/{$key}.php";
$path = $this->languageFilePath.'/'.$this->locale;
$file = "{$path}/{$key}.php";
$keys = $this->mergeWithExistingKeys($file, $value);

$content = $this->exporter->export($keys);
$this->filesystem->ensureDirectoryExists($path);
$this->filesystem->put($file, $content);
}
}
Expand Down

0 comments on commit f042ee4

Please sign in to comment.