xref: /webtrees/app/Module/LanguageKazhak.php (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
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\Localization\Locale\LocaleInterface;
23use Fisharebest\Localization\Locale\LocaleKk;
24use Fisharebest\Webtrees\Encodings\UTF8;
25
26/**
27 * Class LanguageKazhak.
28 */
29class LanguageKazhak extends AbstractModule implements ModuleLanguageInterface
30{
31    use ModuleLanguageTrait;
32
33    /**
34     * Phone-book ordering of letters.
35     *
36     * @return array<int,string>
37     */
38    public function alphabet(): array
39    {
40        return [
41            UTF8::CYRILLIC_CAPITAL_LETTER_A,
42            UTF8::CYRILLIC_CAPITAL_LETTER_BE,
43            UTF8::CYRILLIC_CAPITAL_LETTER_VE,
44            UTF8::CYRILLIC_CAPITAL_LETTER_GHE,
45            UTF8::CYRILLIC_CAPITAL_LETTER_DE,
46            UTF8::CYRILLIC_CAPITAL_LETTER_IE,
47            UTF8::CYRILLIC_CAPITAL_LETTER_IO,
48            UTF8::CYRILLIC_CAPITAL_LETTER_ZHE,
49            UTF8::CYRILLIC_CAPITAL_LETTER_ZE,
50            UTF8::CYRILLIC_CAPITAL_LETTER_I,
51            UTF8::CYRILLIC_CAPITAL_LETTER_SHORT_I,
52            UTF8::CYRILLIC_CAPITAL_LETTER_KA,
53            UTF8::CYRILLIC_CAPITAL_LETTER_EL,
54            UTF8::CYRILLIC_CAPITAL_LETTER_EM,
55            UTF8::CYRILLIC_CAPITAL_LETTER_EN,
56            UTF8::CYRILLIC_CAPITAL_LETTER_O,
57            UTF8::CYRILLIC_CAPITAL_LETTER_PE,
58            UTF8::CYRILLIC_CAPITAL_LETTER_ER,
59            UTF8::CYRILLIC_CAPITAL_LETTER_ES,
60            UTF8::CYRILLIC_CAPITAL_LETTER_TE,
61            UTF8::CYRILLIC_CAPITAL_LETTER_U,
62            UTF8::CYRILLIC_CAPITAL_LETTER_EF,
63            UTF8::CYRILLIC_CAPITAL_LETTER_HA,
64            UTF8::CYRILLIC_CAPITAL_LETTER_TSE,
65            UTF8::CYRILLIC_CAPITAL_LETTER_CHE,
66            UTF8::CYRILLIC_CAPITAL_LETTER_SHA,
67            UTF8::CYRILLIC_CAPITAL_LETTER_SHCHA,
68            UTF8::CYRILLIC_CAPITAL_LETTER_HARD_SIGN,
69            UTF8::CYRILLIC_CAPITAL_LETTER_YERU,
70            UTF8::CYRILLIC_CAPITAL_LETTER_SOFT_SIGN,
71            UTF8::CYRILLIC_CAPITAL_LETTER_E,
72            UTF8::CYRILLIC_CAPITAL_LETTER_YU,
73            UTF8::CYRILLIC_CAPITAL_LETTER_YA,
74        ];
75    }
76
77    /**
78     * @return LocaleInterface
79     */
80    public function locale(): LocaleInterface
81    {
82        return new LocaleKk();
83    }
84
85    /**
86     * Letters with diacritics that are considered distinct letters in this language.
87     *
88     * @return array<string,string>
89     */
90    protected function normalizeExceptions(): array
91    {
92        return [
93            UTF8::CYRILLIC_CAPITAL_LETTER_IE . UTF8::COMBINING_DIAERESIS => UTF8::CYRILLIC_CAPITAL_LETTER_IO,
94            UTF8::CYRILLIC_SMALL_LETTER_IE . UTF8::COMBINING_DIAERESIS   => UTF8::CYRILLIC_SMALL_LETTER_IO,
95            UTF8::CYRILLIC_CAPITAL_LETTER_I . UTF8::COMBINING_BREVE      => UTF8::CYRILLIC_CAPITAL_LETTER_SHORT_I,
96            UTF8::CYRILLIC_SMALL_LETTER_I . UTF8::COMBINING_BREVE        => UTF8::CYRILLIC_SMALL_LETTER_SHORT_I,
97        ];
98    }
99}
100