Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
MohmmedAshraf committed Apr 22, 2024
1 parent ba4e017 commit abc0213
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Actions/SyncPhrasesAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function execute(Translation $source, $key, $value, $locale, $file

$language = Language::where('code', $locale)->first();

if (!$language) {
if (! $language) {
exit;
}

Expand All @@ -25,17 +25,17 @@ public static function execute(Translation $source, $key, $value, $locale, $file
'source' => config('translations.source_language') === $locale,
]);

$isRoot = $file === $locale . '.json' || $file === $locale . '.php';
$isRoot = $file === $locale.'.json' || $file === $locale.'.php';
$extension = pathinfo($file, PATHINFO_EXTENSION);
$filePath = str_replace('.' . $extension, '', str_replace($locale . DIRECTORY_SEPARATOR, '', $file));
$filePath = str_replace('.'.$extension, '', str_replace($locale.DIRECTORY_SEPARATOR, '', $file));

$translationFile = TranslationFile::firstOrCreate([
'name' => $filePath,
'extension' => $extension,
'is_root' => $isRoot,
]);

$key = config('translations.include_file_in_key') && !$isRoot ? "{$translationFile->name}.{$key}" : $key;
$key = config('translations.include_file_in_key') && ! $isRoot ? "{$translationFile->name}.{$key}" : $key;

$translation->phrases()->updateOrCreate([
'key' => $key,
Expand Down

0 comments on commit abc0213

Please sign in to comment.