. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; use Fisharebest\ExtCalendar\ArabicCalendar; use Fisharebest\ExtCalendar\CalendarInterface; use Fisharebest\Localization\Locale\LocaleFa; use Fisharebest\Localization\Locale\LocaleInterface; use Illuminate\Database\Query\Builder; /** * Class LanguageFarsi. */ class LanguageFarsi extends AbstractModule implements ModuleLanguageInterface { use ModuleLanguageTrait; /** * Phone-book ordering of letters. * * @return array */ public function alphabet(): array { return ['ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ي', 'آ', 'ة', 'ى', 'ی']; } /** * Default calendar used by this language. * * @return CalendarInterface */ public function calendar(): CalendarInterface { return new ArabicCalendar(); } /** * @param string $column * @param string $letter * @param Builder $query * * @return void */ public function initialLetterSQL(string $column, string $letter, Builder $query): void { $query->where($column . ' /*! COLLATE utf8_persian_ci */', 'LIKE', '\\' . $letter . '%'); } /** * Should this module be enabled when it is first installed? * * @return bool */ public function isEnabledByDefault(): bool { return false; } /** * @return LocaleInterface */ public function locale(): LocaleInterface { return new LocaleFa(); } }