xref: /webtrees/app/Module/ModuleLanguageInterface.php (revision d11be7027e34e3121be11cc025421873364403f9)
111eb8581SGreg Roach<?php
23976b470SGreg Roach
311eb8581SGreg Roach/**
411eb8581SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
611eb8581SGreg Roach * This program is free software: you can redistribute it and/or modify
711eb8581SGreg Roach * it under the terms of the GNU General Public License as published by
811eb8581SGreg Roach * the Free Software Foundation, either version 3 of the License, or
911eb8581SGreg Roach * (at your option) any later version.
1011eb8581SGreg Roach * This program is distributed in the hope that it will be useful,
1111eb8581SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1211eb8581SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311eb8581SGreg Roach * GNU General Public License for more details.
1411eb8581SGreg 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/>.
1611eb8581SGreg Roach */
17fcfa147eSGreg Roach
1811eb8581SGreg Roachdeclare(strict_types=1);
1911eb8581SGreg Roach
2011eb8581SGreg Roachnamespace Fisharebest\Webtrees\Module;
2111eb8581SGreg Roach
224a9a6095SGreg Roachuse Fisharebest\ExtCalendar\CalendarInterface;
2302086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleInterface;
246fcafd02SGreg Roachuse Fisharebest\Webtrees\Relationship;
254a9a6095SGreg Roachuse Illuminate\Database\Query\Builder;
2602086832SGreg Roach
2711eb8581SGreg Roach/**
2811eb8581SGreg Roach * Interface ModuleLanguageInterface - provide translation and localization.
2911eb8581SGreg Roach */
3011eb8581SGreg Roachinterface ModuleLanguageInterface extends ModuleInterface
3111eb8581SGreg Roach{
3202086832SGreg Roach    /**
334a9a6095SGreg Roach     * Phone-book ordering of letters.
344a9a6095SGreg Roach     *
354a9a6095SGreg Roach     * @return array<int,string>
364a9a6095SGreg Roach     */
374a9a6095SGreg Roach    public function alphabet(): array;
384a9a6095SGreg Roach
394a9a6095SGreg Roach    /**
404a9a6095SGreg Roach     * Default calendar used by this language.
414a9a6095SGreg Roach     *
424a9a6095SGreg Roach     * @return CalendarInterface
434a9a6095SGreg Roach     */
444a9a6095SGreg Roach    public function calendar(): CalendarInterface;
454a9a6095SGreg Roach
464a9a6095SGreg Roach    /**
474a9a6095SGreg Roach     * One of: 'DMY', 'MDY', 'YMD'.
484a9a6095SGreg Roach     *
494a9a6095SGreg Roach     * @return string
504a9a6095SGreg Roach     */
514a9a6095SGreg Roach    public function dateOrder(): string;
524a9a6095SGreg Roach
534a9a6095SGreg Roach    /**
544a9a6095SGreg Roach     * Some languages use digraphs and trigraphs.
554a9a6095SGreg Roach     *
564a9a6095SGreg Roach     * @param string $string
574a9a6095SGreg Roach     *
584a9a6095SGreg Roach     * @return string
594a9a6095SGreg Roach     */
604a9a6095SGreg Roach    public function initialLetter(string $string): string;
614a9a6095SGreg Roach
624a9a6095SGreg Roach    /**
6302086832SGreg Roach     * @return LocaleInterface
6402086832SGreg Roach     */
6502086832SGreg Roach    public function locale(): LocaleInterface;
666fcafd02SGreg Roach
676fcafd02SGreg Roach    /**
6852288ec7SGreg Roach     * Ignore diacritics on letters - unless the language considers them a different letter.
6952288ec7SGreg Roach     *
7052288ec7SGreg Roach     * @param string $text
7152288ec7SGreg Roach     *
7252288ec7SGreg Roach     * @return string
7352288ec7SGreg Roach     */
7452288ec7SGreg Roach    public function normalize(string $text): string;
7552288ec7SGreg Roach
7652288ec7SGreg Roach    /**
776fcafd02SGreg Roach     * @return array<Relationship>
786fcafd02SGreg Roach     */
796fcafd02SGreg Roach    public function relationships(): array;
8011eb8581SGreg Roach}
81