xref: /webtrees/app/Module/LanguageGerman.php (revision 52288ec72a577b9a3a455ccc0f26d11b0df31667)
102086832SGreg Roach<?php
23976b470SGreg Roach
302086832SGreg Roach/**
402086832SGreg Roach * webtrees: online genealogy
55bfc6897SGreg Roach * Copyright (C) 2022 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\LocaleDe;
2302086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleInterface;
24*52288ec7SGreg Roachuse Fisharebest\Webtrees\Encodings\UTF8;
254a9a6095SGreg Roachuse Illuminate\Database\Query\Builder;
2602086832SGreg Roach
2702086832SGreg Roach/**
2802086832SGreg Roach * Class LanguageGerman.
2902086832SGreg Roach */
3002086832SGreg Roachclass LanguageGerman extends AbstractModule implements ModuleLanguageInterface
3102086832SGreg Roach{
3202086832SGreg Roach    use ModuleLanguageTrait;
3302086832SGreg Roach
3402086832SGreg Roach    /**
3502086832SGreg Roach     * @return LocaleInterface
3602086832SGreg Roach     */
3702086832SGreg Roach    public function locale(): LocaleInterface
3802086832SGreg Roach    {
3902086832SGreg Roach        return new LocaleDe();
4002086832SGreg Roach    }
41*52288ec7SGreg Roach
42*52288ec7SGreg Roach    /**
43*52288ec7SGreg Roach     * Letters with diacritics that are considered distinct letters in this language.
44*52288ec7SGreg Roach     *
45*52288ec7SGreg Roach     * @return array<string,string>
46*52288ec7SGreg Roach     */
47*52288ec7SGreg Roach    protected function normalizeExceptions(): array
48*52288ec7SGreg Roach    {
49*52288ec7SGreg Roach        return [
50*52288ec7SGreg Roach            'A' . UTF8::COMBINING_DIAERESIS    => 'AE',
51*52288ec7SGreg Roach            'O' . UTF8::COMBINING_DIAERESIS    => 'OE',
52*52288ec7SGreg Roach            'U' . UTF8::COMBINING_DIAERESIS    => 'UE',
53*52288ec7SGreg Roach            UTF8::LATIN_CAPITAL_LETTER_SHARP_S => 'SS',
54*52288ec7SGreg Roach            'a' . UTF8::COMBINING_DIAERESIS    => 'ae',
55*52288ec7SGreg Roach            'o' . UTF8::COMBINING_DIAERESIS    => 'oe',
56*52288ec7SGreg Roach            'u' . UTF8::COMBINING_DIAERESIS    => 'ue',
57*52288ec7SGreg Roach            UTF8::LATIN_SMALL_LETTER_SHARP_S   => 'ss',
58*52288ec7SGreg Roach        ];
59*52288ec7SGreg Roach    }
6002086832SGreg Roach}
61