fix: Fall back to english only if intl is missing.

This commit is contained in:
Attila Kerekes 2022-11-14 20:35:25 +01:00 committed by Attila Jozsef Kerekes
parent 153bb0e91d
commit a3c75b2dd4
No known key found for this signature in database
GPG key ID: E1121565A016ADFD

View file

@ -17,6 +17,11 @@ class SettingsSeeder extends Seeder
*/ */
public static function getSupportedLanguageMap() public static function getSupportedLanguageMap()
{ {
if (! class_exists('Locale')) {
Log::info('PHP Extension Intl not found. Falling back to English language support only.');
return json_encode(['en' => 'English']);
}
$languageDirectories = array_filter(glob(resource_path().'/lang/*'), 'is_dir'); $languageDirectories = array_filter(glob(resource_path().'/lang/*'), 'is_dir');
$result = []; $result = [];