xref: /webtrees/app/Module/LanguageLithuanian.php (revision c5cb081f84eaf817fc43486524a23d6714850ec0)
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\LocaleLt;
24use Fisharebest\Webtrees\Encodings\UTF8;
25use Illuminate\Database\Query\Builder;
26
27/**
28 * Class LanguageLithuanian.
29 */
30class LanguageLithuanian extends AbstractModule implements ModuleLanguageInterface
31{
32    use ModuleLanguageTrait;
33
34    /**
35     * Phone-book ordering of letters.
36     *
37     * @return array<int,string>
38     */
39    public function alphabet(): array
40    {
41        return [
42            'A',
43            UTF8::LATIN_CAPITAL_LETTER_A_WITH_OGONEK,
44            'B',
45            'C',
46            UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
47            'D',
48            'E',
49            UTF8::LATIN_CAPITAL_LETTER_E_WITH_OGONEK,
50            UTF8::LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE,
51            'F',
52            'G',
53            'H',
54            'I',
55            'Y',
56            UTF8::LATIN_CAPITAL_LETTER_I_WITH_OGONEK,
57            'J',
58            'K',
59            'L',
60            'M',
61            'N',
62            'O',
63            'P',
64            'R',
65            'S',
66            UTF8::LATIN_CAPITAL_LETTER_S_WITH_CARON,
67            'T',
68            'U',
69            UTF8::LATIN_CAPITAL_LETTER_U_WITH_OGONEK,
70            UTF8::LATIN_CAPITAL_LETTER_U_WITH_MACRON,
71            'V',
72            'Z',
73            UTF8::LATIN_CAPITAL_LETTER_Z_WITH_CARON,
74        ];
75    }
76
77    /**
78     * One of: 'DMY', 'MDY', 'YMD'.
79     *
80     * @return string
81     */
82    public function dateOrder(): string
83    {
84        return 'YMD';
85    }
86
87    /**
88     * @return LocaleInterface
89     */
90    public function locale(): LocaleInterface
91    {
92        return new LocaleLt();
93    }
94
95
96    /**
97     * Letters with diacritics that are considered distinct letters in this language.
98     *
99     * @return array<string,string>
100     */
101    protected function normalizeExceptions(): array
102    {
103        return [
104            'A' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_A_WITH_OGONEK,
105            'C' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
106            'E' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_E_WITH_OGONEK,
107            'E' . UTF8::COMBINING_DOT_ABOVE => UTF8::LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE,
108            'I' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_I_WITH_OGONEK,
109            'S' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_S_WITH_CARON,
110            'U' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_OGONEK,
111            'U' . UTF8::COMBINING_MACRON    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_MACRON,
112            'Z' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_Z_WITH_CARON,
113            'a' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_A_WITH_OGONEK,
114            'c' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
115            'e' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_E_WITH_OGONEK,
116            'e' . UTF8::COMBINING_DOT_ABOVE => UTF8::LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE,
117            'i' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_I_WITH_OGONEK,
118            's' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_S_WITH_CARON,
119            'u' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_OGONEK,
120            'u' . UTF8::COMBINING_MACRON    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_MACRON,
121            'z' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_Z_WITH_CARON,
122        ];
123    }
124}
125