xref: /webtrees/app/Module/LanguageArabic.php (revision b11cdcd45131b1585d66693fab363cfeb18c51a4)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * 'Copyright (C) 2023 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Module;
21
22use Fisharebest\ExtCalendar\ArabicCalendar;
23use Fisharebest\ExtCalendar\CalendarInterface;
24use Fisharebest\Localization\Locale\LocaleAr;
25use Fisharebest\Localization\Locale\LocaleInterface;
26use Fisharebest\Webtrees\Encodings\UTF8;
27
28/**
29 * Class LanguageArabic.
30 */
31class LanguageArabic extends AbstractModule implements ModuleLanguageInterface
32{
33    use ModuleLanguageTrait;
34
35    /**
36     * Phone-book ordering of letters.
37     *
38     * @return array<int,string>
39     */
40    public function alphabet(): array
41    {
42        return [
43            UTF8::ARABIC_LETTER_ALEF,
44            UTF8::ARABIC_LETTER_BEH,
45            UTF8::ARABIC_LETTER_TEH,
46            UTF8::ARABIC_LETTER_THEH,
47            UTF8::ARABIC_LETTER_JEEM,
48            UTF8::ARABIC_LETTER_HAH,
49            UTF8::ARABIC_LETTER_KHAH,
50            UTF8::ARABIC_LETTER_DAL,
51            UTF8::ARABIC_LETTER_THAL,
52            UTF8::ARABIC_LETTER_REH,
53            UTF8::ARABIC_LETTER_ZAIN,
54            UTF8::ARABIC_LETTER_SEEN,
55            UTF8::ARABIC_LETTER_SHEEN,
56            UTF8::ARABIC_LETTER_SAD,
57            UTF8::ARABIC_LETTER_DAD,
58            UTF8::ARABIC_LETTER_TAH,
59            UTF8::ARABIC_LETTER_ZAH,
60            UTF8::ARABIC_LETTER_AIN,
61            UTF8::ARABIC_LETTER_GHAIN,
62            UTF8::ARABIC_LETTER_FEH,
63            UTF8::ARABIC_LETTER_QAF,
64            UTF8::ARABIC_LETTER_KAF,
65            UTF8::ARABIC_LETTER_LAM,
66            UTF8::ARABIC_LETTER_MEEM,
67            UTF8::ARABIC_LETTER_NOON,
68            UTF8::ARABIC_LETTER_HEH,
69            UTF8::ARABIC_LETTER_WAW,
70            UTF8::ARABIC_LETTER_YEH,
71            UTF8::ARABIC_LETTER_HAMZA,
72            UTF8::ARABIC_LETTER_TEH_MARBUTA,
73            UTF8::ARABIC_LETTER_ALEF_MAKSURA,
74            UTF8::ARABIC_LETTER_WAW,
75        ];
76    }
77
78    /**
79     * Default calendar used by this language.
80     *
81     * @return CalendarInterface
82     */
83    public function calendar(): CalendarInterface
84    {
85        return new ArabicCalendar();
86    }
87
88    /**
89     * @return LocaleInterface
90     */
91    public function locale(): LocaleInterface
92    {
93        return new LocaleAr();
94    }
95}
96