xref: /webtrees/app/Module/LanguageKazhak.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
102086832SGreg Roach<?php
23976b470SGreg Roach
302086832SGreg Roach/**
402086832SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 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
2202086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleInterface;
2302086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleKk;
2452288ec7SGreg Roachuse Fisharebest\Webtrees\Encodings\UTF8;
2502086832SGreg Roach
2602086832SGreg Roach/**
2702086832SGreg Roach * Class LanguageKazhak.
2802086832SGreg Roach */
2902086832SGreg Roachclass LanguageKazhak extends AbstractModule implements ModuleLanguageInterface
3002086832SGreg Roach{
3102086832SGreg Roach    use ModuleLanguageTrait;
3202086832SGreg Roach
3302086832SGreg Roach    /**
344a9a6095SGreg Roach     * Phone-book ordering of letters.
354a9a6095SGreg Roach     *
364a9a6095SGreg Roach     * @return array<int,string>
374a9a6095SGreg Roach     */
384a9a6095SGreg Roach    public function alphabet(): array
394a9a6095SGreg Roach    {
4052288ec7SGreg Roach        return [
4152288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_A,
4252288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_BE,
4352288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_VE,
4452288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_GHE,
4552288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_DE,
4652288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_IE,
4752288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_IO,
4852288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_ZHE,
4952288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_ZE,
5052288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_I,
5152288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_SHORT_I,
5252288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_KA,
5352288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_EL,
5452288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_EM,
5552288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_EN,
5652288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_O,
5752288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_PE,
5852288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_ER,
5952288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_ES,
6052288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_TE,
6152288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_U,
6252288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_EF,
6352288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_HA,
6452288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_TSE,
6552288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_CHE,
6652288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_SHA,
6752288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_SHCHA,
6852288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_HARD_SIGN,
6952288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_YERU,
7052288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_SOFT_SIGN,
7152288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_E,
7252288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_YU,
7352288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_YA,
7452288ec7SGreg Roach        ];
754a9a6095SGreg Roach    }
764a9a6095SGreg Roach
774a9a6095SGreg Roach    /**
7802086832SGreg Roach     * @return LocaleInterface
7902086832SGreg Roach     */
8002086832SGreg Roach    public function locale(): LocaleInterface
8102086832SGreg Roach    {
8202086832SGreg Roach        return new LocaleKk();
8302086832SGreg Roach    }
8452288ec7SGreg Roach
8552288ec7SGreg Roach    /**
8652288ec7SGreg Roach     * Letters with diacritics that are considered distinct letters in this language.
8752288ec7SGreg Roach     *
8852288ec7SGreg Roach     * @return array<string,string>
8952288ec7SGreg Roach     */
9052288ec7SGreg Roach    protected function normalizeExceptions(): array
9152288ec7SGreg Roach    {
9252288ec7SGreg Roach        return [
9352288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_IE . UTF8::COMBINING_DIAERESIS => UTF8::CYRILLIC_CAPITAL_LETTER_IO,
9452288ec7SGreg Roach            UTF8::CYRILLIC_SMALL_LETTER_IE . UTF8::COMBINING_DIAERESIS   => UTF8::CYRILLIC_SMALL_LETTER_IO,
9552288ec7SGreg Roach            UTF8::CYRILLIC_CAPITAL_LETTER_I . UTF8::COMBINING_BREVE      => UTF8::CYRILLIC_CAPITAL_LETTER_SHORT_I,
9652288ec7SGreg Roach            UTF8::CYRILLIC_SMALL_LETTER_I . UTF8::COMBINING_BREVE        => UTF8::CYRILLIC_SMALL_LETTER_SHORT_I,
9752288ec7SGreg Roach        ];
9852288ec7SGreg Roach    }
9902086832SGreg Roach}
100