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