. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; use Fisharebest\Localization\Locale\LocaleInterface; use Fisharebest\Localization\Locale\LocaleNl; use function mb_substr; use function str_starts_with; /** * Class LanguageDutch. */ class LanguageDutch extends AbstractModule implements ModuleLanguageInterface { use ModuleLanguageTrait; /** * Phone-book ordering of letters. * * @return array */ public function alphabet(): array { return ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'IJ']; } /** * Some languages use digraphs and trigraphs. * * @param string $string * * @return string */ public function initialLetter(string $string): string { if (str_starts_with($string, 'IJ')) { return 'IJ'; } return mb_substr($string, 0, 1); } /** * @return LocaleInterface */ public function locale(): LocaleInterface { return new LocaleNl(); } }