2025-03-22 16:41:26 +01:00

24 lines
518 B
PHP

<?php
namespace Vanguard\Support;
class Locale
{
public const AVAILABLE_LOCALES = ['en', 'de', 'sr'];
public static function flagUrl(string $locale): ?string
{
return match ($locale) {
'en' => url('/flags/GB.png'),
'de' => url('/flags/DE.png'),
'sr' => url('/flags/RS.png'),
default => null,
};
}
public static function validateLocale(string $locale): bool
{
return in_array($locale, self::AVAILABLE_LOCALES);
}
}