This commit is contained in:
Ahmed Darrazi 2025-12-16 23:56:53 +01:00
parent d84c9f9c8a
commit 50c7e9562b

View File

@ -27,9 +27,6 @@ class LanguageService extends MediaService
$langDir = $langPath . "/" . $data['code']; $langDir = $langPath . "/" . $data['code'];
$appLangPath = storage_path('app/lang/default'); $appLangPath = storage_path('app/lang/default');
if (is_dir($langDir)) {
throw new Exception("Language already exist");
}
$groups = [ $groups = [
'auth' => require storage_path('app/lang/groups/auth.php'), 'auth' => require storage_path('app/lang/groups/auth.php'),
@ -53,8 +50,12 @@ class LanguageService extends MediaService
} }
} }
File::makeDirectory($langDir, 0777, true, true); $alreadyExists = is_dir($langDir);
File::copyDirectory($appLangPath, $langDir);
if (! $alreadyExists) {
File::makeDirectory($langDir, 0777, true, true);
File::copyDirectory($appLangPath, $langDir);
}
} }
function updateLanguage($id, $data) function updateLanguage($id, $data)