xref: /webtrees/app/Module/LanguageFarsi.php (revision 52288ec72a577b9a3a455ccc0f26d11b0df31667)
102086832SGreg Roach<?php
23976b470SGreg Roach
302086832SGreg Roach/**
402086832SGreg Roach * webtrees: online genealogy
55bfc6897SGreg Roach * Copyright (C) 2022 webtrees development team
602086832SGreg Roach * This program is free software: you can redistribute it and/or modify
702086832SGreg Roach * it under the terms of the GNU General Public License as published by
802086832SGreg Roach * the Free Software Foundation, either version 3 of the License, or
902086832SGreg Roach * (at your option) any later version.
1002086832SGreg Roach * This program is distributed in the hope that it will be useful,
1102086832SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1202086832SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1302086832SGreg Roach * GNU General Public License for more details.
1402086832SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
1602086832SGreg Roach */
17fcfa147eSGreg Roach
1802086832SGreg Roachdeclare(strict_types=1);
1902086832SGreg Roach
2002086832SGreg Roachnamespace Fisharebest\Webtrees\Module;
2102086832SGreg Roach
224a9a6095SGreg Roachuse Fisharebest\ExtCalendar\ArabicCalendar;
234a9a6095SGreg Roachuse Fisharebest\ExtCalendar\CalendarInterface;
2402086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleFa;
2502086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleInterface;
26*52288ec7SGreg Roachuse Fisharebest\Webtrees\Encodings\UTF8;
274a9a6095SGreg Roachuse Illuminate\Database\Query\Builder;
2802086832SGreg Roach
2902086832SGreg Roach/**
3002086832SGreg Roach * Class LanguageFarsi.
3102086832SGreg Roach */
3202086832SGreg Roachclass LanguageFarsi extends AbstractModule implements ModuleLanguageInterface
3302086832SGreg Roach{
3402086832SGreg Roach    use ModuleLanguageTrait;
3502086832SGreg Roach
3602086832SGreg Roach    /**
374a9a6095SGreg Roach     * Phone-book ordering of letters.
384a9a6095SGreg Roach     *
394a9a6095SGreg Roach     * @return array<int,string>
404a9a6095SGreg Roach     */
414a9a6095SGreg Roach    public function alphabet(): array
424a9a6095SGreg Roach    {
43*52288ec7SGreg Roach        return [
44*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_ALEF,
45*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_BEH,
46*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_TEH,
47*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_THEH,
48*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_JEEM,
49*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_HAH,
50*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_KHAH,
51*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_DAL,
52*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_THAL,
53*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_REH,
54*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_ZAIN,
55*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_SEEN,
56*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_SHEEN,
57*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_SAD,
58*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_DAD,
59*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_TAH,
60*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_ZAH,
61*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_AIN,
62*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_GHAIN,
63*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_FEH,
64*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_QAF,
65*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_KAF,
66*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_LAM,
67*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_MEEM,
68*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_NOON,
69*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_HEH,
70*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_WAW,
71*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_YEH,
72*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_HAMZA,
73*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_TEH_MARBUTA,
74*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_ALEF_MAKSURA,
75*52288ec7SGreg Roach            UTF8::ARABIC_LETTER_WAW,
76*52288ec7SGreg Roach        ];
774a9a6095SGreg Roach    }
784a9a6095SGreg Roach
794a9a6095SGreg Roach    /**
804a9a6095SGreg Roach     * Default calendar used by this language.
814a9a6095SGreg Roach     *
824a9a6095SGreg Roach     * @return CalendarInterface
834a9a6095SGreg Roach     */
844a9a6095SGreg Roach    public function calendar(): CalendarInterface
854a9a6095SGreg Roach    {
864a9a6095SGreg Roach        return new ArabicCalendar();
874a9a6095SGreg Roach    }
884a9a6095SGreg Roach
894a9a6095SGreg Roach    /**
9002086832SGreg Roach     * Should this module be enabled when it is first installed?
9102086832SGreg Roach     *
9202086832SGreg Roach     * @return bool
9302086832SGreg Roach     */
9402086832SGreg Roach    public function isEnabledByDefault(): bool
9502086832SGreg Roach    {
9602086832SGreg Roach        return false;
9702086832SGreg Roach    }
9802086832SGreg Roach
9902086832SGreg Roach    /**
10002086832SGreg Roach     * @return LocaleInterface
10102086832SGreg Roach     */
10202086832SGreg Roach    public function locale(): LocaleInterface
10302086832SGreg Roach    {
10402086832SGreg Roach        return new LocaleFa();
10502086832SGreg Roach    }
10602086832SGreg Roach}
107