xref: /webtrees/app/Module/LanguageLithuanian.php (revision e873f434551745f888937263ff89e80db3b0f785)
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     * Letters with diacritics that are considered distinct letters in this language.
97     *
98     * @return array<string,string>
99     */
100    protected function normalizeExceptions(): array
101    {
102        return [
103            'A' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_A_WITH_OGONEK,
104            'C' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
105            'E' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_E_WITH_OGONEK,
106            'E' . UTF8::COMBINING_DOT_ABOVE => UTF8::LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE,
107            'I' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_I_WITH_OGONEK,
108            'S' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_S_WITH_CARON,
109            'U' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_OGONEK,
110            'U' . UTF8::COMBINING_MACRON    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_MACRON,
111            'Z' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_Z_WITH_CARON,
112            'a' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_A_WITH_OGONEK,
113            'c' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
114            'e' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_E_WITH_OGONEK,
115            'e' . UTF8::COMBINING_DOT_ABOVE => UTF8::LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE,
116            'i' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_I_WITH_OGONEK,
117            's' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_S_WITH_CARON,
118            'u' . UTF8::COMBINING_OGONEK    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_OGONEK,
119            'u' . UTF8::COMBINING_MACRON    => UTF8::LATIN_CAPITAL_LETTER_U_WITH_MACRON,
120            'z' . UTF8::COMBINING_CARON     => UTF8::LATIN_CAPITAL_LETTER_Z_WITH_CARON,
121        ];
122    }
123}
124