xref: /webtrees/app/Module/LanguageSlovakian.php (revision 6fcafd028e511367c3fcdbfaa31aa05a85bf85c0)
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;
24*6fcafd02SGreg Roachuse Fisharebest\Webtrees\Relationship;
25*6fcafd02SGreg Roach
26*6fcafd02SGreg 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
35*6fcafd02SGreg Roach    protected const MALE_COUSINS = [
36*6fcafd02SGreg Roach        ['', ''],
37*6fcafd02SGreg Roach        ['bratranec', '%s bratranca'],
38*6fcafd02SGreg Roach        ['druhostupňový bratranca', '%s druhostupňový bratranca'],
39*6fcafd02SGreg Roach        ['bratranec z 3. kolena', '%s bratranca z 3. kolena'],
40*6fcafd02SGreg Roach        ['bratranec zo 4. kolena', '%s bratranca zo 4. kolena'],
41*6fcafd02SGreg Roach        ['bratranec z 5. kolena', '%s bratranca z 5. kolena'],
42*6fcafd02SGreg Roach        ['bratranec zo 6. kolena', '%s bratranca zo 6. kolena'],
43*6fcafd02SGreg Roach        ['bratranec zo 7. kolena', '%s bratranca zo 7. kolena'],
44*6fcafd02SGreg Roach        ['bratranec z 8. kolena', '%s bratranca z 8. kolena'],
45*6fcafd02SGreg Roach        ['bratranec z 9. kolena', '%s bratranca z 9. kolena'],
46*6fcafd02SGreg Roach        ['bratranec z 10. kolena', '%s bratranca z 10. kolena'],
47*6fcafd02SGreg Roach        ['bratranec z 11. kolena', '%s bratranca z 11. kolena'],
48*6fcafd02SGreg Roach        ['bratranec z 12. kolena', '%s bratranca z 12. kolena'],
49*6fcafd02SGreg Roach        ['bratranec z 13. kolena', '%s bratranca z 13. kolena'],
50*6fcafd02SGreg Roach        ['bratranec zo 14. kolena', '%s bratranca zo 14. kolena'],
51*6fcafd02SGreg Roach        ['bratranec z 15. kolena', '%s bratranca z 15. kolena'],
52*6fcafd02SGreg Roach        ['bratranec zo 16. kolena', '%s bratranca zo 16. kolena'],
53*6fcafd02SGreg Roach        ['bratranec zo 17. kolena', '%s bratranca zo 17. kolena'],
54*6fcafd02SGreg Roach    ];
55*6fcafd02SGreg Roach
56*6fcafd02SGreg Roach    protected const FEMALE_COUSINS = [
57*6fcafd02SGreg Roach        ['', ''],
58*6fcafd02SGreg Roach        ['sesternica', '%s sesternice'],
59*6fcafd02SGreg Roach        ['druhostupňový sesternica', '%s druhostupňový sesternice'],
60*6fcafd02SGreg Roach        ['sesternica z 3. kolena', '%s sesternice z 3. kolena'],
61*6fcafd02SGreg Roach        ['sesternica zo 4. kolena', '%s sesternice zo 4. kolena'],
62*6fcafd02SGreg Roach        ['sesternica z 5. kolena', '%s sesternice z 5. kolena'],
63*6fcafd02SGreg Roach        ['sesternica zo 6. kolena', '%s sesternice zo 6. kolena'],
64*6fcafd02SGreg Roach        ['sesternica zo 7. kolena', '%s sesternice zo 7. kolena'],
65*6fcafd02SGreg Roach        ['sesternica z 8. kolena', '%s sesternice z 8. kolena'],
66*6fcafd02SGreg Roach        ['sesternica z 9. kolena', '%s sesternice z 9. kolena'],
67*6fcafd02SGreg Roach        ['sesternica z 10. kolena', '%s sesternice z 10. kolena'],
68*6fcafd02SGreg Roach        ['sesternica z 11. kolena', '%s sesternice z 11. kolena'],
69*6fcafd02SGreg Roach        ['sesternica z 12. kolena', '%s sesternice z 12. kolena'],
70*6fcafd02SGreg Roach        ['sesternica z 13. kolena', '%s sesternice z 13. kolena'],
71*6fcafd02SGreg Roach        ['sesternica zo 14. kolena', '%s sesternice zo 14. kolena'],
72*6fcafd02SGreg Roach        ['sesternica z 15. kolena', '%s sesternice z 15. kolena'],
73*6fcafd02SGreg Roach        ['sesternica zo 16. kolena', '%s sesternice zo 16. kolena'],
74*6fcafd02SGreg Roach        ['sesternica zo 17. kolena', '%s sesternice zo 17. kolena'],
75*6fcafd02SGreg Roach    ];
76*6fcafd02SGreg Roach
7702086832SGreg Roach    /**
7802086832SGreg Roach     * @return LocaleInterface
7902086832SGreg Roach     */
8002086832SGreg Roach    public function locale(): LocaleInterface
8102086832SGreg Roach    {
8202086832SGreg Roach        return new LocaleSk();
8302086832SGreg Roach    }
84*6fcafd02SGreg Roach    /**
85*6fcafd02SGreg Roach     * @return array<Relationship>
86*6fcafd02SGreg Roach     */
87*6fcafd02SGreg Roach    public function relationships(): array
88*6fcafd02SGreg Roach    {
89*6fcafd02SGreg Roach        $pra = fn (int $n, string $nominative, string $genitive): array => [
90*6fcafd02SGreg Roach            ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $nominative,
91*6fcafd02SGreg Roach            ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $genitive,
92*6fcafd02SGreg Roach        ];
93*6fcafd02SGreg Roach
94*6fcafd02SGreg Roach        $cousin = fn (int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [
95*6fcafd02SGreg Roach            $nominative . ' z ' . $n . '. kolena',
96*6fcafd02SGreg Roach            $genitive . '%s z ' . $n . '. kolena',
97*6fcafd02SGreg Roach        ];
98*6fcafd02SGreg Roach
99*6fcafd02SGreg Roach        return [
100*6fcafd02SGreg Roach            // Parents
101*6fcafd02SGreg Roach            Relationship::fixed('otec', '%s otca')->father(),
102*6fcafd02SGreg Roach            Relationship::fixed('matka', '%s matky')->mother(),
103*6fcafd02SGreg Roach            Relationship::fixed('rodič', '%s rodiča')->parent(),
104*6fcafd02SGreg Roach            // Children
105*6fcafd02SGreg Roach            Relationship::fixed('syn', '%s syna')->son(),
106*6fcafd02SGreg Roach            Relationship::fixed('dcéra', '%s dcéry')->daughter(),
107*6fcafd02SGreg Roach            Relationship::fixed('dcéra', '%s dcéry')->child(),
108*6fcafd02SGreg Roach            // Siblings
109*6fcafd02SGreg Roach            Relationship::fixed('brat', '%s brata')->brother(),
110*6fcafd02SGreg Roach            Relationship::fixed('sestra', '%s sestry')->sister(),
111*6fcafd02SGreg Roach            Relationship::fixed('súrodenec', '%s súrodenca')->sibling(),
112*6fcafd02SGreg Roach            // Divorced partners
113*6fcafd02SGreg Roach            Relationship::fixed('exmanželka', '%s exmanželka')->divorced()->partner()->female(),
114*6fcafd02SGreg Roach            Relationship::fixed('exmanžel', '%s exmanžela')->divorced()->partner()->male(),
115*6fcafd02SGreg Roach            Relationship::fixed('exmanžel/manželka', '%s exmanžel/manželka')->divorced()->partner(),
116*6fcafd02SGreg Roach            // Engaged partners
117*6fcafd02SGreg Roach            Relationship::fixed('snúbenec', '%s snúbenec')->engaged()->partner()->female(),
118*6fcafd02SGreg Roach            Relationship::fixed('snúbenica', '%s snúbenica')->engaged()->partner()->male(),
119*6fcafd02SGreg Roach            // Married parters
120*6fcafd02SGreg Roach            Relationship::fixed('manželka', '%s manželky')->wife(),
121*6fcafd02SGreg Roach            Relationship::fixed('manžel', '%s manžela')->husband(),
122*6fcafd02SGreg Roach            Relationship::fixed('manžel/manželka', '%s manžel/manželka')->spouse(),
123*6fcafd02SGreg Roach            Relationship::fixed('partnerka', '%s partnerky')->partner()->female(),
124*6fcafd02SGreg Roach            // Unmarried partners
125*6fcafd02SGreg Roach            Relationship::fixed('partner', '%s partnera')->partner(),
126*6fcafd02SGreg Roach            // In-laws
127*6fcafd02SGreg Roach            Relationship::fixed('tesť', '%s tesťa')->wife()->father(),
128*6fcafd02SGreg Roach            Relationship::fixed('testiná', '%s testinej')->wife()->mother(),
129*6fcafd02SGreg Roach            Relationship::fixed('svokor', '%s svokra')->spouse()->father(),
130*6fcafd02SGreg Roach            Relationship::fixed('svokora', '%s svokry')->spouse()->mother(),
131*6fcafd02SGreg Roach            Relationship::fixed('zať', '%s zaťa')->child()->husband(),
132*6fcafd02SGreg Roach            Relationship::fixed('nevesta', '%s nevesty')->child()->wife(),
133*6fcafd02SGreg Roach            Relationship::fixed('švagor', '%s švagra')->spouse()->brother(),
134*6fcafd02SGreg Roach            Relationship::fixed('švagor', '%s švagra')->sibling()->husband(),
135*6fcafd02SGreg Roach            Relationship::fixed('švagriná', '%s švagrinej')->spouse()->sister(),
136*6fcafd02SGreg Roach            Relationship::fixed('švagriná', '%s švagrinej')->sibling()->wife(),
137*6fcafd02SGreg Roach            // Half-siblings
138*6fcafd02SGreg Roach            Relationship::fixed('nevlastný brat', '%s nevlastného brata')->parent()->son(),
139*6fcafd02SGreg Roach            Relationship::fixed('nevlastná sestra', '%s nevlastnej sestry')->parent()->daughter(),
140*6fcafd02SGreg Roach            Relationship::fixed('nevlastná súrodenec', '%s nevlastnej súrodenca')->parent()->child(),
141*6fcafd02SGreg Roach            // Grandparents
142*6fcafd02SGreg Roach            Relationship::fixed('starý otec', '%s starého otca')->parent()->father(),
143*6fcafd02SGreg Roach            Relationship::fixed('stará matka', '%s starej matky')->parent()->mother(),
144*6fcafd02SGreg Roach            Relationship::fixed('starý rodič', '%s starého rodiča')->parent()->parent(),
145*6fcafd02SGreg Roach            // Great-grandparents
146*6fcafd02SGreg Roach            Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->father(),
147*6fcafd02SGreg Roach            Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->mother(),
148*6fcafd02SGreg Roach            Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->parent(),
149*6fcafd02SGreg Roach            // Ancestors
150*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(),
151*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(),
152*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(),
153*6fcafd02SGreg Roach            // Grandchildren
154*6fcafd02SGreg Roach            Relationship::fixed('vnuk', '%s vnuka')->child()->son(),
155*6fcafd02SGreg Roach            Relationship::fixed('vnučka', '%s vnučky')->child()->daughter(),
156*6fcafd02SGreg Roach            Relationship::fixed('vnúča', '%s vnúčaťa')->child()->child(),
157*6fcafd02SGreg Roach            // Great-grandchildren
158*6fcafd02SGreg Roach            Relationship::fixed('pravnuk', '%s pravnuka')->child()->child()->son(),
159*6fcafd02SGreg Roach            Relationship::fixed('pravnučka', '%s pravnučky')->child()->child()->daughter(),
160*6fcafd02SGreg Roach            Relationship::fixed('pravnúča', '%s pravnúčaťa')->child()->child()->child(),
161*6fcafd02SGreg Roach            // Descendants
162*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(),
163*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnučka', '%s prastarej matky'))->ancestor()->female(),
164*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(),
165*6fcafd02SGreg Roach            // Aunts and uncles
166*6fcafd02SGreg Roach            Relationship::fixed('ujo', '%s uja')->mother()->brother(),
167*6fcafd02SGreg Roach            Relationship::fixed('ujčiná', '%s ujčinej')->mother()->brother()->wife(),
168*6fcafd02SGreg Roach            Relationship::fixed('stryná', '%s strynej')->father()->brother()->wife(),
169*6fcafd02SGreg Roach            Relationship::fixed('strýko', '%s strýka')->parent()->brother(),
170*6fcafd02SGreg Roach            Relationship::fixed('teta', '%s tety')->parent()->sister(),
171*6fcafd02SGreg Roach            // Great-aunts and great-uncles
172*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(),
173*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(),
174*6fcafd02SGreg Roach            // Nieces and nephews
175*6fcafd02SGreg Roach            Relationship::fixed('neter', '%s netere')->sibling()->son(),
176*6fcafd02SGreg Roach            Relationship::fixed('synovec', '%s synovca')->sibling()->daughter(),
177*6fcafd02SGreg Roach            // Great-nieces and great-nephews
178*6fcafd02SGreg Roach            Relationship::fixed('prasynovec', '%s prasynovca')->sibling()->child()->son(),
179*6fcafd02SGreg Roach            Relationship::fixed('praneter', '%s pranetere')->sibling()->child()->daughter(),
180*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(),
181*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(),
182*6fcafd02SGreg Roach            // Cousins
183*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(),
184*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(),
185*6fcafd02SGreg Roach            Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(),
186*6fcafd02SGreg Roach        ];
187*6fcafd02SGreg Roach    }
18802086832SGreg Roach}
189