102086832SGreg Roach<?php 23976b470SGreg Roach 302086832SGreg Roach/** 402086832SGreg Roach * webtrees: online genealogy 589f7189bSGreg Roach * Copyright (C) 2021 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\LocaleInterface; 2302086832SGreg Roachuse Fisharebest\Localization\Locale\LocaleSk; 246fcafd02SGreg Roachuse Fisharebest\Webtrees\Relationship; 256fcafd02SGreg Roach 266fcafd02SGreg Roachuse function str_repeat; 2702086832SGreg Roach 2802086832SGreg Roach/** 2902086832SGreg Roach * Class LanguageSlovakian. 3002086832SGreg Roach */ 3102086832SGreg Roachclass LanguageSlovakian extends AbstractModule implements ModuleLanguageInterface 3202086832SGreg Roach{ 3302086832SGreg Roach use ModuleLanguageTrait; 3402086832SGreg Roach 356fcafd02SGreg Roach protected const MALE_COUSINS = [ 366fcafd02SGreg Roach ['', ''], 376fcafd02SGreg Roach ['bratranec', '%s bratranca'], 387af58572Sro-la ['druhostupňový bratranec', '%s druhostupňového bratranca'], 396fcafd02SGreg Roach ['bratranec z 3. kolena', '%s bratranca z 3. kolena'], 406fcafd02SGreg Roach ['bratranec zo 4. kolena', '%s bratranca zo 4. kolena'], 416fcafd02SGreg Roach ['bratranec z 5. kolena', '%s bratranca z 5. kolena'], 426fcafd02SGreg Roach ['bratranec zo 6. kolena', '%s bratranca zo 6. kolena'], 436fcafd02SGreg Roach ['bratranec zo 7. kolena', '%s bratranca zo 7. kolena'], 446fcafd02SGreg Roach ['bratranec z 8. kolena', '%s bratranca z 8. kolena'], 456fcafd02SGreg Roach ['bratranec z 9. kolena', '%s bratranca z 9. kolena'], 466fcafd02SGreg Roach ['bratranec z 10. kolena', '%s bratranca z 10. kolena'], 476fcafd02SGreg Roach ['bratranec z 11. kolena', '%s bratranca z 11. kolena'], 486fcafd02SGreg Roach ['bratranec z 12. kolena', '%s bratranca z 12. kolena'], 496fcafd02SGreg Roach ['bratranec z 13. kolena', '%s bratranca z 13. kolena'], 506fcafd02SGreg Roach ['bratranec zo 14. kolena', '%s bratranca zo 14. kolena'], 516fcafd02SGreg Roach ['bratranec z 15. kolena', '%s bratranca z 15. kolena'], 526fcafd02SGreg Roach ['bratranec zo 16. kolena', '%s bratranca zo 16. kolena'], 536fcafd02SGreg Roach ['bratranec zo 17. kolena', '%s bratranca zo 17. kolena'], 546fcafd02SGreg Roach ]; 556fcafd02SGreg Roach 566fcafd02SGreg Roach protected const FEMALE_COUSINS = [ 576fcafd02SGreg Roach ['', ''], 586fcafd02SGreg Roach ['sesternica', '%s sesternice'], 597af58572Sro-la ['druhostupňová sesternica', '%s druhostupňovej sesternice'], 606fcafd02SGreg Roach ['sesternica z 3. kolena', '%s sesternice z 3. kolena'], 616fcafd02SGreg Roach ['sesternica zo 4. kolena', '%s sesternice zo 4. kolena'], 626fcafd02SGreg Roach ['sesternica z 5. kolena', '%s sesternice z 5. kolena'], 636fcafd02SGreg Roach ['sesternica zo 6. kolena', '%s sesternice zo 6. kolena'], 646fcafd02SGreg Roach ['sesternica zo 7. kolena', '%s sesternice zo 7. kolena'], 656fcafd02SGreg Roach ['sesternica z 8. kolena', '%s sesternice z 8. kolena'], 666fcafd02SGreg Roach ['sesternica z 9. kolena', '%s sesternice z 9. kolena'], 676fcafd02SGreg Roach ['sesternica z 10. kolena', '%s sesternice z 10. kolena'], 686fcafd02SGreg Roach ['sesternica z 11. kolena', '%s sesternice z 11. kolena'], 696fcafd02SGreg Roach ['sesternica z 12. kolena', '%s sesternice z 12. kolena'], 706fcafd02SGreg Roach ['sesternica z 13. kolena', '%s sesternice z 13. kolena'], 716fcafd02SGreg Roach ['sesternica zo 14. kolena', '%s sesternice zo 14. kolena'], 726fcafd02SGreg Roach ['sesternica z 15. kolena', '%s sesternice z 15. kolena'], 736fcafd02SGreg Roach ['sesternica zo 16. kolena', '%s sesternice zo 16. kolena'], 746fcafd02SGreg Roach ['sesternica zo 17. kolena', '%s sesternice zo 17. kolena'], 756fcafd02SGreg Roach ]; 766fcafd02SGreg Roach 7702086832SGreg Roach /** 7802086832SGreg Roach * @return LocaleInterface 7902086832SGreg Roach */ 8002086832SGreg Roach public function locale(): LocaleInterface 8102086832SGreg Roach { 8202086832SGreg Roach return new LocaleSk(); 8302086832SGreg Roach } 846fcafd02SGreg Roach /** 856fcafd02SGreg Roach * @return array<Relationship> 866fcafd02SGreg Roach */ 876fcafd02SGreg Roach public function relationships(): array 886fcafd02SGreg Roach { 89*05babb96SGreg Roach $pra = static fn (int $n, string $nominative, string $genitive): array => [ 906fcafd02SGreg Roach ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $nominative, 916fcafd02SGreg Roach ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $genitive, 926fcafd02SGreg Roach ]; 936fcafd02SGreg Roach 94*05babb96SGreg Roach $cousin = static fn (int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [ 956fcafd02SGreg Roach $nominative . ' z ' . $n . '. kolena', 966fcafd02SGreg Roach $genitive . '%s z ' . $n . '. kolena', 976fcafd02SGreg Roach ]; 986fcafd02SGreg Roach 996fcafd02SGreg Roach return [ 1006fcafd02SGreg Roach // Parents 1016fcafd02SGreg Roach Relationship::fixed('otec', '%s otca')->father(), 1026fcafd02SGreg Roach Relationship::fixed('matka', '%s matky')->mother(), 1036fcafd02SGreg Roach Relationship::fixed('rodič', '%s rodiča')->parent(), 1046fcafd02SGreg Roach // Children 1056fcafd02SGreg Roach Relationship::fixed('syn', '%s syna')->son(), 1066fcafd02SGreg Roach Relationship::fixed('dcéra', '%s dcéry')->daughter(), 1077af58572Sro-la Relationship::fixed('dieťa', '%s dieťaťa')->child(), 1086fcafd02SGreg Roach // Siblings 1096fcafd02SGreg Roach Relationship::fixed('brat', '%s brata')->brother(), 1106fcafd02SGreg Roach Relationship::fixed('sestra', '%s sestry')->sister(), 1116fcafd02SGreg Roach Relationship::fixed('súrodenec', '%s súrodenca')->sibling(), 1126fcafd02SGreg Roach // Divorced partners 1137af58572Sro-la Relationship::fixed('exmanželka', '%s exmanželky')->divorced()->partner()->female(), 1146fcafd02SGreg Roach Relationship::fixed('exmanžel', '%s exmanžela')->divorced()->partner()->male(), 1157af58572Sro-la Relationship::fixed('exmanžel/manželka', '%s exmanžela/manželky')->divorced()->partner(), 1166fcafd02SGreg Roach // Engaged partners 1177af58572Sro-la Relationship::fixed('snúbenec', '%s snúbence')->engaged()->partner()->female(), 1187af58572Sro-la Relationship::fixed('snúbenica', '%s snúbenice')->engaged()->partner()->male(), 1196fcafd02SGreg Roach // Married parters 1206fcafd02SGreg Roach Relationship::fixed('manželka', '%s manželky')->wife(), 1216fcafd02SGreg Roach Relationship::fixed('manžel', '%s manžela')->husband(), 1227af58572Sro-la Relationship::fixed('manžel/manželka', '%s manžela/manželky')->spouse(), 1236fcafd02SGreg Roach Relationship::fixed('partnerka', '%s partnerky')->partner()->female(), 1246fcafd02SGreg Roach // Unmarried partners 1256fcafd02SGreg Roach Relationship::fixed('partner', '%s partnera')->partner(), 1266fcafd02SGreg Roach // In-laws 1276fcafd02SGreg Roach Relationship::fixed('tesť', '%s tesťa')->wife()->father(), 1286fcafd02SGreg Roach Relationship::fixed('testiná', '%s testinej')->wife()->mother(), 1296fcafd02SGreg Roach Relationship::fixed('svokor', '%s svokra')->spouse()->father(), 1307af58572Sro-la Relationship::fixed('svokra', '%s svokry')->spouse()->mother(), 1316fcafd02SGreg Roach Relationship::fixed('zať', '%s zaťa')->child()->husband(), 1326fcafd02SGreg Roach Relationship::fixed('nevesta', '%s nevesty')->child()->wife(), 1336fcafd02SGreg Roach Relationship::fixed('švagor', '%s švagra')->spouse()->brother(), 1346fcafd02SGreg Roach Relationship::fixed('švagor', '%s švagra')->sibling()->husband(), 1356fcafd02SGreg Roach Relationship::fixed('švagriná', '%s švagrinej')->spouse()->sister(), 1366fcafd02SGreg Roach Relationship::fixed('švagriná', '%s švagrinej')->sibling()->wife(), 1376fcafd02SGreg Roach // Half-siblings 1386fcafd02SGreg Roach Relationship::fixed('nevlastný brat', '%s nevlastného brata')->parent()->son(), 1396fcafd02SGreg Roach Relationship::fixed('nevlastná sestra', '%s nevlastnej sestry')->parent()->daughter(), 1407af58572Sro-la Relationship::fixed('nevlastný súrodenec', '%s nevlastného súrodenca')->parent()->child(), 1416fcafd02SGreg Roach // Grandparents 1426fcafd02SGreg Roach Relationship::fixed('starý otec', '%s starého otca')->parent()->father(), 1436fcafd02SGreg Roach Relationship::fixed('stará matka', '%s starej matky')->parent()->mother(), 1446fcafd02SGreg Roach Relationship::fixed('starý rodič', '%s starého rodiča')->parent()->parent(), 1456fcafd02SGreg Roach // Great-grandparents 1466fcafd02SGreg Roach Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->father(), 1476fcafd02SGreg Roach Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->mother(), 1486fcafd02SGreg Roach Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->parent(), 1496fcafd02SGreg Roach // Ancestors 1506fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), 1516fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), 1526fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), 1536fcafd02SGreg Roach // Grandchildren 1546fcafd02SGreg Roach Relationship::fixed('vnuk', '%s vnuka')->child()->son(), 1556fcafd02SGreg Roach Relationship::fixed('vnučka', '%s vnučky')->child()->daughter(), 1566fcafd02SGreg Roach Relationship::fixed('vnúča', '%s vnúčaťa')->child()->child(), 1576fcafd02SGreg Roach // Great-grandchildren 1586fcafd02SGreg Roach Relationship::fixed('pravnuk', '%s pravnuka')->child()->child()->son(), 1596fcafd02SGreg Roach Relationship::fixed('pravnučka', '%s pravnučky')->child()->child()->daughter(), 1606fcafd02SGreg Roach Relationship::fixed('pravnúča', '%s pravnúčaťa')->child()->child()->child(), 1616fcafd02SGreg Roach // Descendants 1626fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), 1637af58572Sro-la Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), 1646fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), 1656fcafd02SGreg Roach // Aunts and uncles 1666fcafd02SGreg Roach Relationship::fixed('ujo', '%s uja')->mother()->brother(), 1676fcafd02SGreg Roach Relationship::fixed('ujčiná', '%s ujčinej')->mother()->brother()->wife(), 1686fcafd02SGreg Roach Relationship::fixed('stryná', '%s strynej')->father()->brother()->wife(), 1696fcafd02SGreg Roach Relationship::fixed('strýko', '%s strýka')->parent()->brother(), 1706fcafd02SGreg Roach Relationship::fixed('teta', '%s tety')->parent()->sister(), 1716fcafd02SGreg Roach // Great-aunts and great-uncles 1726fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), 1736fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), 1746fcafd02SGreg Roach // Nieces and nephews 175604d62afSro-la Relationship::fixed('synovec', '%s synovca')->sibling()->son(), 176604d62afSro-la Relationship::fixed('neter', '%s netere')->sibling()->daughter(), 1776fcafd02SGreg Roach // Great-nieces and great-nephews 1786fcafd02SGreg Roach Relationship::fixed('prasynovec', '%s prasynovca')->sibling()->child()->son(), 1796fcafd02SGreg Roach Relationship::fixed('praneter', '%s pranetere')->sibling()->child()->daughter(), 1806fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), 1816fcafd02SGreg Roach Relationship::dynamic(fn (int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), 1826fcafd02SGreg Roach // Cousins 1836fcafd02SGreg Roach Relationship::dynamic(fn (int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), 1846fcafd02SGreg Roach Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), 1856fcafd02SGreg Roach Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), 1866fcafd02SGreg Roach ]; 1876fcafd02SGreg Roach } 18802086832SGreg Roach} 189