From 64513a4ebd53447d677b3d6e99f055fd668bf089 Mon Sep 17 00:00:00 2001 From: Franz Frese Date: Tue, 13 May 2025 20:52:15 +0200 Subject: [PATCH 01/13] Update RelationshipNamesTest.php --- tests/feature/RelationshipNamesTest.php | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/feature/RelationshipNamesTest.php b/tests/feature/RelationshipNamesTest.php index 1d8673e0902..e86d14570da 100644 --- a/tests/feature/RelationshipNamesTest.php +++ b/tests/feature/RelationshipNamesTest.php @@ -371,6 +371,58 @@ public function testRelationshipNames(): void self::assertRelationships('druhostupňový bratranec starej matky', 'vnuk druhostupňovej sesternice', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $sk); self::assertRelationships('pra-pra-dcéra prastrýka', 'pravnuk bratranca', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $sk); // Compound relationships self::assertRelationships('exmanžel manželky', 'manžel exmanželky', [$i1m, $f1m, $i2f, $f2d, $i6m], $sk); + + /////////////////////////////////////////////////////////////////////// + // German + /////////////////////////////////////////////////////////////////////// + + $en = new LanguageGerman(); + + self::assertRelationships('Ehefrau', 'Ehemann', [$i1m, $f1m, $i2f], $en); + self::assertRelationships('Partner', 'Partner', [$i9u, $f6, $i15u], $en); + self::assertRelationships('Ex-Mann', 'Ex-Frau', [$i2f, $f2d, $i6m], $en); + self::assertRelationships('Verlobter', 'Verlobte', [$i10f, $f3e, $i3m], $en); + self::assertRelationships('Sohn', 'Vater', [$i1m, $f1m, $i3m], $en); + self::assertRelationships('Tochter', 'Mutter', [$i2f, $f1m, $i4f], $en); + self::assertRelationships('Kind', 'Vater', [$i1m, $f1m, $i5u], $en); + self::assertRelationships('Älterer Bruder', 'Jüngere Schwester', [$i4f, $f1m, $i3m], $en); + self::assertRelationships('Jüngeres Geschwister', 'Älterer Bruder', [$i3m, $f1m, $i5u], $en); + self::assertRelationships('Bruder', 'Schwester', [$i8f, $f2d, $i7ma], $en); + self::assertRelationships('Geschwister', 'Bruder', [$i7ma, $f2d, $i9u], $en); + self::assertRelationships('Adoptivmutter', 'Adoptivsohn', [$i7ma, $f2d, $i2f], $en); + self::assertRelationships('Stiefvater', 'Stiefkind', [$i9u, $f2d, $i2f, $f1m, $i1m], $en); + self::assertRelationships('Stieftochter', 'Stiefmutter', [$i2f, $f1m, $i2f, $f2d, $i8f], $en); + self::assertRelationships('Stiefschwester', 'Stiefgeschwister', [$i9u, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $en); + self::assertRelationships('Halbbruder', 'Halbschwester', [$i8f, $f2d, $i2f, $f1m, $i3m], $en); + self::assertRelationships('Schwiegermutter', 'Schwiegertochter', [$i2f, $f1m, $i1m, $f4m, $i12f], $en); + self::assertRelationships('Großvater väterlicherseits', 'Enkel', [$i3m, $f1m, $i1m, $f4m, $i11m], $en); + self::assertRelationships('Großmutter väterlicherseits', 'Enkelin', [$i4f, $f1m, $i1m, $f4m, $i12f], $en); + self::assertRelationships('Großvater mütterlicherseits', 'Enkel', [$i3m, $f1m, $i2f, $f5m, $i13m], $en); + self::assertRelationships('Großmutter mütterlicherseits', 'Enkelin/Enkel', [$i5u, $f1m, $i2f, $f5m, $i14f], $en); + self::assertRelationships('Urgroßvater (väterlicherseits) ', 'Urenkel', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $en); + // self::assertRelationships('paternal great-grandmother', 'great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $en); + // self::assertRelationships('paternal great-great-grandfather', 'great-great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $en); + // self::assertRelationships('paternal great-great-grandmother', 'great-great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $en); + // self::assertRelationships('paternal great-great-great-grandfather', 'great-great-great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $en); + // self::assertRelationships('paternal great-great-great-grandmother', 'great-great-great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $en); + // self::assertRelationships('paternal great ×4 grandfather', 'great ×4 grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i22m], $en); + // self::assertRelationships('paternal great ×4 grandmother', 'great ×4 granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i23f], $en); + self::assertRelationships('Tante', 'Nichte', [$i38f, $f7, $i17f, $f8, $i37f], $en); + self::assertRelationships('Großonkel', 'Großneffe', [$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en); + self::assertRelationships('Urgroßonkel', 'Urgroßneffe', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en); + self::assertRelationships('Neffe', 'Onkel', [$i24m, $f10, $i21f, $f9, $i18m], $en); + self::assertRelationships('Großnichte', 'Großonkel', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $en); + self::assertRelationships('Urgroßneffe', 'Urgroßonkel', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m], $en); + // self::assertRelationships('first cousin', 'first cousin', [$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); + // self::assertRelationships('second cousin', 'second cousin', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); + // self::assertRelationships('first cousin once removed ascending', 'first cousin once removed descending', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); + // self::assertRelationships('third cousin', 'third cousin', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $en); + // self::assertRelationships('second cousin once removed ascending', 'second cousin once removed descending', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); + // self::assertRelationships('first cousin twice removed ascending', 'first cousin twice removed descending', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); + // self::assertRelationships('fourth cousin', 'fourth cousin', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f, $f16, $i35m], $en); + // self::assertRelationships('third cousin once removed ascending', 'third cousin once removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $en); + // self::assertRelationships('second cousin twice removed ascending', 'second cousin twice removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); + } /** From bef8eefc69f062f2f1c99e27e672a1fe1ebf5ada Mon Sep 17 00:00:00 2001 From: Franz Frese Date: Tue, 13 May 2025 20:54:06 +0200 Subject: [PATCH 02/13] Update LanguageGerman.php --- app/Module/LanguageGerman.php | 168 +++++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 1 deletion(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 043b363297a..5003df476ae 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -2,7 +2,7 @@ /** * webtrees: online genealogy - * Copyright (C) 2025 webtrees development team + * Copyright (C) 2023 webtrees development team * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -21,12 +21,20 @@ use Fisharebest\Localization\Locale\LocaleDe; use Fisharebest\Localization\Locale\LocaleInterface; +use Fisharebest\Webtrees\Relationship; use Fisharebest\Webtrees\Encodings\UTF8; +// use Illuminate\Database\Query\Builder; +/** + * Class LanguageGerman. + */ class LanguageGerman extends AbstractModule implements ModuleLanguageInterface { use ModuleLanguageTrait; + /** + * @return LocaleInterface + */ public function locale(): LocaleInterface { return new LocaleDe(); @@ -50,4 +58,162 @@ protected function normalizeExceptions(): array UTF8::LATIN_SMALL_LETTER_SHARP_S => 'ss', ]; } + public function relationships(): array + { + // returns array => [nominativ, genitive %s] + // $genitive = static fn (string $prefix, string $suffix): array => [$prefix . $suffix, $prefix . 's' . $suffix . '%s']; + $genitive = static fn (string $prefix, string $suffix, int $gender): array => + ($gender == 0) ? [$prefix . $suffix, '%s' . ' des ' . $prefix . 's' . $suffix] : (($gender == 1) ? [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix] : [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix]); + + $ur = static fn (int $n, string $simpleGreat, string $suffix, int $gender): array => $genitive( + (($n > 1) ? ($n + 1) . ' x Ur' : (($n > -1) ? 'Ur' . str_repeat('ur', $n) : '')) . $simpleGreat, $suffix, $gender + // $n <= -1 -> '' + // $n == 0 -> Ur + // $n == 1 -> Urur + // $n >= 2 -> $n+1 ' x Ur' + ); + + return [ + // Adopted + Relationship::fixed('Adoptivmutter', '%s der Adoptivmutter')->adoptive()->mother(), + Relationship::fixed('Adoptivvater', '%s des Adoptivvaters')->adoptive()->father(), + Relationship::fixed('Adoptiveltern', '%s der Adoptiveltern')->adoptive()->parent(), + Relationship::fixed('Adoptivtochter', '%s der Adoptivtochter')->adopted()->daughter(), + Relationship::fixed('Adoptivsohn', '%s des Adoptivsohnes')->adopted()->son(), + Relationship::fixed('Adoptivkind', '%s des Adoptivkindes')->adopted()->child(), + // Fostered + Relationship::fixed('Pflegemutter', '%s der Pflegemutter')->fostering()->mother(), + Relationship::fixed('Pflegevater', '%s des Pflegevaters')->fostering()->father(), + Relationship::fixed('Pflegeeltern', '%s der Pflegeeltern')->fostering()->parent(), + Relationship::fixed('Pflegetochter', '%s der Pflegetochter')->fostered()->daughter(), + Relationship::fixed('Pflegesohn', '%s des Pflegesohnes')->fostered()->son(), + Relationship::fixed('Pflegekind', '%s des Pflegekindes')->fostered()->child(), + // Parents + Relationship::fixed('Mutter', '%s der Mutter')->mother(), + Relationship::fixed('Vater', '%s des Vaters')->father(), + Relationship::fixed('Elternteil', '%s der Eltern')->parent(), + // Children + Relationship::fixed('Tochter', '%s der Tochter')->daughter(), + Relationship::fixed('Sohn', '%s des Sohnes')->son(), + Relationship::fixed('Kind', '%s des Kindes')->child(), + // Siblings + Relationship::fixed('Zwillingsschwester', '%s der Zwillingsschwester')->twin()->sister(), + Relationship::fixed('Zwillingsbruder', '%s des Zwillingsbruders')->twin()->brother(), + Relationship::fixed('Zwillingsgeschwister', '%s des Zwillingsgeschwisters')->twin()->sibling(), + Relationship::fixed('Ältere Schwester', '%s der älterer Schwester')->older()->sister(), + Relationship::fixed('Älterer Bruder', '%s des älteren Bruders')->older()->brother(), + Relationship::fixed('Älteres Geschwister', '%s des älteren Geschwisters')->older()->sibling(), + Relationship::fixed('Jüngere Schwester', '%s der jüngeren Schwester')->younger()->sister(), + Relationship::fixed('Jüngerer Bruder', '%s des jüngeren Bruders')->younger()->brother(), + Relationship::fixed('Jüngeres Geschwister', '%s des jüngeres Geschwisters')->younger()->sibling(), + Relationship::fixed('Schwester', '%s der Schwester')->sister(), + Relationship::fixed('Bruder', '%s des Bruders')->brother(), + Relationship::fixed('Geschwister', '%s der Geschwister')->sibling(), + // Half-siblings + Relationship::fixed('Halbschwester', '%s der Halbschwester')->parent()->daughter(), + Relationship::fixed('Halbbruder', '%s des Halbbruders')->parent()->son(), + Relationship::fixed('Halbgeschwister', '%s der Halbgeschwister')->parent()->child(), + // Stepfamily + Relationship::fixed('Stiefmutter', '%s der Stiefmutter')->parent()->wife(), + Relationship::fixed('Stiefvater', '%s des Stiefvaters')->parent()->husband(), + Relationship::fixed('Stiefelternteil', '%s des Stiefelternteils')->parent()->married()->spouse(), + Relationship::fixed('Stieftochter', '%s der Stieftochter')->married()->spouse()->daughter(), + Relationship::fixed('Stiefsohn', '%s des Stiefsohnes')->married()->spouse()->son(), + Relationship::fixed('Stiefkind', '%s des Stiefkindes')->married()->spouse()->child(), + Relationship::fixed('Stiefschwester', '%s der Stiefschwester')->parent()->spouse()->daughter(), + Relationship::fixed('Stiefbruder', '%s des Stiefbruders')->parent()->spouse()->son(), + Relationship::fixed('Stiefgeschwister', '%s der Stiefgeschwister')->parent()->spouse()->child(), + // Cousin / Cousine + Relationship::fixed('Cousine', '%s der Cousine')->parent()->sister()->child()->female(), + Relationship::fixed('Cousine', '%s der Cousine')->parent()->brother()->child()->female(), + Relationship::fixed('Cousin', '%s des Cousins')->parent()->sister()->child()->male(), + Relationship::fixed('Cousin', '%s des Cousins')->parent()->brother()->child()->male(), + // Partners + Relationship::fixed('Ex-Frau', '%s der Ex-Frau')->divorced()->partner()->female(), + Relationship::fixed('Ex-Mann', '%s des Ex-Mannes')->divorced()->partner()->male(), + Relationship::fixed('Ex-Ehepartner', '%s des Ex-Ehepartners')->divorced()->partner(), + Relationship::fixed('Verlobte', '%s der Verlobten')->engaged()->partner()->female(), + Relationship::fixed('Verlobter', '%s des Verlobten')->engaged()->partner()->male(), + Relationship::fixed('Ehefrau', '%s der Ehefrau')->wife(), + Relationship::fixed('Ehemann', '%s des Ehemannes')->husband(), + Relationship::fixed('Ehepartner', '%s des Ehepartners')->spouse(), + Relationship::fixed('Partner', '%s des Partners')->partner(), + // In-laws + Relationship::fixed('Schwiegermutter', '%s der Schwiegermutter')->married()->spouse()->mother(), + Relationship::fixed('Schwiegervater', '%s des Schwiegervaters')->married()->spouse()->father(), + Relationship::fixed('Schwiegereltern', '%s der Schwiegereltern')->married()->spouse()->parent(), + Relationship::fixed('Schwiegertochter', '%s der Schwiegertochter')->child()->wife(), + Relationship::fixed('Schwiegersohn', '%s des Schwiegersohnes')->child()->husband(), + Relationship::fixed('Schwiegerkind', '%s des Schwiegerkindes')->child()->married()->spouse(), + // + Relationship::fixed('Schwägerin', '%s der Schwägerin')->sibling()->spouse()->sister(), + Relationship::fixed('Schwager', '%s des Schwagers')->sibling()->spouse()->brother(), + Relationship::fixed('Schwager/Schwägerin', '%s des Schwagers / der Schwägerin')->sibling()->spouse()->sibling(), + Relationship::fixed('Schwägerin', '%s der Schwägerin')->spouse()->sister(), + Relationship::fixed('Schwager', '%s des Schwagers')->spouse()->brother(), + Relationship::fixed('Schwager/Schwägerin', '%s des Schwagers / der Schwägerin')->spouse()->sibling(), + Relationship::fixed('Schwägerin', '%s der Schwägerin')->sibling()->wife(), + Relationship::fixed('Schwager', '%s des Schwagers')->sibling()->husband(), + Relationship::fixed('Schwager/Schwägerin', '%s des Schwagers / der Schwägerin')->sibling()->spouse(), + // Grandparents + Relationship::fixed('Großmutter mütterlicherseits', '%s der Großmutter (mütterlicherseits)')->mother()->mother(), + Relationship::fixed('Großvater mütterlicherseits', '%s des Großvaters (mütterlicherseits)')->mother()->father(), + Relationship::fixed('Großeltern mütterlicherseits', '%s der Großeltern (mütterlicherseits)')->mother()->parent(), + Relationship::fixed('Großmutter väterlicherseits', '%s der Großmutter (väterlicherseits)')->father()->mother(), + Relationship::fixed('Großvater väterlicherseits', '%s des Großvaters (väterlicherseits)')->father()->father(), + Relationship::fixed('Großeltern väterlicherseits', '%s der Großeltern (väterlicherseits)')->father()->parent(), + // + Relationship::fixed('Großmutter', '%s der Großmutter')->parent()->mother(), + Relationship::fixed('Großvater', '%s des Großvaters')->parent()->father(), + Relationship::fixed('Großeltern', '%s der Großeltern')->parent()->parent(), + // Grandchildren + Relationship::fixed('Enkelin', '%s der Enkelin')->child()->daughter(), + Relationship::fixed('Enkel', '%s des Enkels')->child()->son(), + Relationship::fixed('Enkelin/Enkel', '%s der Enkelin/des Enkels')->child()->child(), + // Nichte / Neffe + Relationship::fixed('Nichte', '%s der Nichte')->sibling()->daughter(), + Relationship::fixed('Nichte', '%s der Nichte')->married()->spouse()->sibling()->daughter(), + Relationship::fixed('Neffe', '%s des Neffen')->sibling()->son(), + Relationship::fixed('Neffe', '%s des Neffen')->married()->spouse()->sibling()->son(), + Relationship::fixed('Nichte/Neffe', '%s der Nichte / des Neffen')->sibling()->child(), + Relationship::fixed('Nichte/Neffe', '%s der Nichte/ des Neffen')->married()->spouse()->sibling()->child(), + // Großnichte / Großneffe + Relationship::fixed('Großnichte', '%s der Großnichte')->sibling()->child()->child()->female(), + Relationship::fixed('Großnichte', '%s der Großnichte')->married()->spouse()->sibling()->child()->child()->female(), + Relationship::fixed('Großneffe', '%s des Großneffen')->sibling()->child()->child()->male(), + Relationship::fixed('Großneffe', '%s des Großneffen')->married()->spouse()->sibling()->child()->child()->male(), + // Tante / Onkel + Relationship::fixed('Tante', '%s der Tante')->parent()->sister(), + Relationship::fixed('Tante', '%s der Tante')->parent()->brother()->wife(), + Relationship::fixed('Onkel', '%s des Onkels')->parent()->sister()->husband(), + Relationship::fixed('Onkel', '%s des Onkels')->parent()->brother(), + // Großtante / Großonkel + Relationship::fixed('Großtante', '%s der Großtante')->parent()->parent()->sister(), + Relationship::fixed('Großtante', '%s der Großtante')->parent()->parent()->brother()->wife(), + Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->brother(), + Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->sister()->husband(), + // Relationships with dynamically generated names + // ancestors: n=2 -> Urgroßmutter (mütterlicherseits) / Großmutter der Mutter + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits) ', 1))->mother()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits) ', 0))->mother()->ancestor()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits) ', 1))->father()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits) ', 0))->father()->ancestor()->male(), + // + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits) ', 2))->father()->ancestor(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits) ', 2))->mother()->ancestor(), + // + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', ' ', 1))->ancestor()->sister(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', ' ', 1))->ancestor()->sibling()->wife(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', ' ', 0))->ancestor()->brother(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', ' ', 0))->ancestor()->sibling()->husband(), + // descendants + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', ' ', 1))->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', ' ', 1))->married()->spouse()->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', ' ', 0))->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), ' ', 0)->married()->spouse()->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', ' ', 1))->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', ' ', 0))->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', ' ', 2))->descendant(), + ]; + } } From 786c57d4a004c32b0e993b14577c7613f1ff83b9 Mon Sep 17 00:00:00 2001 From: Franz Frese Date: Tue, 13 May 2025 20:57:15 +0200 Subject: [PATCH 03/13] Update LanguageGerman.php --- app/Module/LanguageGerman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 5003df476ae..0887aa5965a 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -2,7 +2,7 @@ /** * webtrees: online genealogy - * Copyright (C) 2023 webtrees development team + * Copyright (C) 2025 webtrees development team * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or From f72e3c0100c5cd9c1d9a632e32938b6b12ee992a Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 11:55:38 +0100 Subject: [PATCH 04/13] Add missing import --- tests/feature/RelationshipNamesTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/feature/RelationshipNamesTest.php b/tests/feature/RelationshipNamesTest.php index e86d14570da..f1c0ed93b3a 100644 --- a/tests/feature/RelationshipNamesTest.php +++ b/tests/feature/RelationshipNamesTest.php @@ -25,6 +25,7 @@ use Fisharebest\Webtrees\Module\LanguageEnglishGreatBritain; use Fisharebest\Webtrees\Module\LanguageEnglishUnitedStates; use Fisharebest\Webtrees\Module\LanguageFrench; +use Fisharebest\Webtrees\Module\LanguageGerman; use Fisharebest\Webtrees\Module\LanguageSlovakian; use Fisharebest\Webtrees\Module\ModuleLanguageInterface; use Fisharebest\Webtrees\Services\RelationshipService; From cccc85db6a60fd6856dd5ccbd1aa54a0cd06a3bf Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 11:57:20 +0100 Subject: [PATCH 05/13] Remove trailing spaces --- tests/feature/RelationshipNamesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/feature/RelationshipNamesTest.php b/tests/feature/RelationshipNamesTest.php index f1c0ed93b3a..d748820b062 100644 --- a/tests/feature/RelationshipNamesTest.php +++ b/tests/feature/RelationshipNamesTest.php @@ -400,7 +400,7 @@ public function testRelationshipNames(): void self::assertRelationships('Großmutter väterlicherseits', 'Enkelin', [$i4f, $f1m, $i1m, $f4m, $i12f], $en); self::assertRelationships('Großvater mütterlicherseits', 'Enkel', [$i3m, $f1m, $i2f, $f5m, $i13m], $en); self::assertRelationships('Großmutter mütterlicherseits', 'Enkelin/Enkel', [$i5u, $f1m, $i2f, $f5m, $i14f], $en); - self::assertRelationships('Urgroßvater (väterlicherseits) ', 'Urenkel', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $en); + self::assertRelationships('Urgroßvater (väterlicherseits)', 'Urenkel', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $en); // self::assertRelationships('paternal great-grandmother', 'great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $en); // self::assertRelationships('paternal great-great-grandfather', 'great-great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $en); // self::assertRelationships('paternal great-great-grandmother', 'great-great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $en); From 5b7a97cf3397552e9cd45de4b41e45ef945d7ee0 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 11:58:11 +0100 Subject: [PATCH 06/13] Remove trailing spaces --- app/Module/LanguageGerman.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 0887aa5965a..2609105a3ae 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -194,26 +194,26 @@ public function relationships(): array Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->sister()->husband(), // Relationships with dynamically generated names // ancestors: n=2 -> Urgroßmutter (mütterlicherseits) / Großmutter der Mutter - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits) ', 1))->mother()->ancestor()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits) ', 0))->mother()->ancestor()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits) ', 1))->father()->ancestor()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits) ', 0))->father()->ancestor()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits)', 1))->mother()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits)', 0))->mother()->ancestor()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits)', 1))->father()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits)', 0))->father()->ancestor()->male(), // - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits) ', 2))->father()->ancestor(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits) ', 2))->mother()->ancestor(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits)', 2))->father()->ancestor(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits)', 2))->mother()->ancestor(), // - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', ' ', 1))->ancestor()->sister(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', ' ', 1))->ancestor()->sibling()->wife(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', ' ', 0))->ancestor()->brother(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', ' ', 0))->ancestor()->sibling()->husband(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sister(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sibling()->wife(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->brother(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->sibling()->husband(), // descendants - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', ' ', 1))->sibling()->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', ' ', 1))->married()->spouse()->sibling()->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', ' ', 0))->sibling()->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), ' ', 0)->married()->spouse()->sibling()->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', ' ', 1))->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', ' ', 0))->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', ' ', 2))->descendant(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->married()->spouse()->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 0))->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), '', 0)->married()->spouse()->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', '', 1))->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', '', 0))->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', '', 2))->descendant(), ]; } } From 349536f36d54fbda1c3fdea7d121810914b55976 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 12:02:24 +0100 Subject: [PATCH 07/13] PSR12 coding style. --- tests/feature/RelationshipNamesTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/feature/RelationshipNamesTest.php b/tests/feature/RelationshipNamesTest.php index d748820b062..6db793170a5 100644 --- a/tests/feature/RelationshipNamesTest.php +++ b/tests/feature/RelationshipNamesTest.php @@ -423,7 +423,6 @@ public function testRelationshipNames(): void // self::assertRelationships('fourth cousin', 'fourth cousin', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f, $f16, $i35m], $en); // self::assertRelationships('third cousin once removed ascending', 'third cousin once removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $en); // self::assertRelationships('second cousin twice removed ascending', 'second cousin twice removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); - } /** From 32824d837c2224ddcc9a90d8e4cb614f63d55783 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 12:06:29 +0100 Subject: [PATCH 08/13] PSR12 code style --- app/Module/LanguageGerman.php | 46 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 2609105a3ae..18229ae91c8 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -23,7 +23,6 @@ use Fisharebest\Localization\Locale\LocaleInterface; use Fisharebest\Webtrees\Relationship; use Fisharebest\Webtrees\Encodings\UTF8; -// use Illuminate\Database\Query\Builder; /** * Class LanguageGerman. @@ -58,19 +57,22 @@ protected function normalizeExceptions(): array UTF8::LATIN_SMALL_LETTER_SHARP_S => 'ss', ]; } - public function relationships(): array + + public function relationships(): array { // returns array => [nominativ, genitive %s] // $genitive = static fn (string $prefix, string $suffix): array => [$prefix . $suffix, $prefix . 's' . $suffix . '%s']; - $genitive = static fn (string $prefix, string $suffix, int $gender): array => - ($gender == 0) ? [$prefix . $suffix, '%s' . ' des ' . $prefix . 's' . $suffix] : (($gender == 1) ? [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix] : [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix]); - + $genitive = static fn (string $prefix, string $suffix, int $gender): array => + ($gender == 0) ? [$prefix . $suffix, '%s' . ' des ' . $prefix . 's' . $suffix] : (($gender == 1) ? [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix] : [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix]); + + // $n <= -1 -> '' + // $n == 0 -> Ur + // $n == 1 -> Urur + // $n >= 2 -> $n+1 ' x Ur' $ur = static fn (int $n, string $simpleGreat, string $suffix, int $gender): array => $genitive( - (($n > 1) ? ($n + 1) . ' x Ur' : (($n > -1) ? 'Ur' . str_repeat('ur', $n) : '')) . $simpleGreat, $suffix, $gender - // $n <= -1 -> '' - // $n == 0 -> Ur - // $n == 1 -> Urur - // $n >= 2 -> $n+1 ' x Ur' + (($n > 1) ? ($n + 1) . ' x Ur' : (($n > -1) ? 'Ur' . str_repeat('ur', $n) : '')) . $simpleGreat, + $suffix, + $gender ); return [ @@ -123,7 +125,7 @@ public function relationships(): array Relationship::fixed('Stiefschwester', '%s der Stiefschwester')->parent()->spouse()->daughter(), Relationship::fixed('Stiefbruder', '%s des Stiefbruders')->parent()->spouse()->son(), Relationship::fixed('Stiefgeschwister', '%s der Stiefgeschwister')->parent()->spouse()->child(), - // Cousin / Cousine + // Cousin / Cousine Relationship::fixed('Cousine', '%s der Cousine')->parent()->sister()->child()->female(), Relationship::fixed('Cousine', '%s der Cousine')->parent()->brother()->child()->female(), Relationship::fixed('Cousin', '%s des Cousins')->parent()->sister()->child()->male(), @@ -145,7 +147,7 @@ public function relationships(): array Relationship::fixed('Schwiegertochter', '%s der Schwiegertochter')->child()->wife(), Relationship::fixed('Schwiegersohn', '%s des Schwiegersohnes')->child()->husband(), Relationship::fixed('Schwiegerkind', '%s des Schwiegerkindes')->child()->married()->spouse(), - // + // Relationship::fixed('Schwägerin', '%s der Schwägerin')->sibling()->spouse()->sister(), Relationship::fixed('Schwager', '%s des Schwagers')->sibling()->spouse()->brother(), Relationship::fixed('Schwager/Schwägerin', '%s des Schwagers / der Schwägerin')->sibling()->spouse()->sibling(), @@ -162,7 +164,7 @@ public function relationships(): array Relationship::fixed('Großmutter väterlicherseits', '%s der Großmutter (väterlicherseits)')->father()->mother(), Relationship::fixed('Großvater väterlicherseits', '%s des Großvaters (väterlicherseits)')->father()->father(), Relationship::fixed('Großeltern väterlicherseits', '%s der Großeltern (väterlicherseits)')->father()->parent(), - // + // Relationship::fixed('Großmutter', '%s der Großmutter')->parent()->mother(), Relationship::fixed('Großvater', '%s des Großvaters')->parent()->father(), Relationship::fixed('Großeltern', '%s der Großeltern')->parent()->parent(), @@ -170,43 +172,43 @@ public function relationships(): array Relationship::fixed('Enkelin', '%s der Enkelin')->child()->daughter(), Relationship::fixed('Enkel', '%s des Enkels')->child()->son(), Relationship::fixed('Enkelin/Enkel', '%s der Enkelin/des Enkels')->child()->child(), - // Nichte / Neffe + // Nichte / Neffe Relationship::fixed('Nichte', '%s der Nichte')->sibling()->daughter(), - Relationship::fixed('Nichte', '%s der Nichte')->married()->spouse()->sibling()->daughter(), + Relationship::fixed('Nichte', '%s der Nichte')->married()->spouse()->sibling()->daughter(), Relationship::fixed('Neffe', '%s des Neffen')->sibling()->son(), Relationship::fixed('Neffe', '%s des Neffen')->married()->spouse()->sibling()->son(), Relationship::fixed('Nichte/Neffe', '%s der Nichte / des Neffen')->sibling()->child(), Relationship::fixed('Nichte/Neffe', '%s der Nichte/ des Neffen')->married()->spouse()->sibling()->child(), - // Großnichte / Großneffe + // Großnichte / Großneffe Relationship::fixed('Großnichte', '%s der Großnichte')->sibling()->child()->child()->female(), Relationship::fixed('Großnichte', '%s der Großnichte')->married()->spouse()->sibling()->child()->child()->female(), Relationship::fixed('Großneffe', '%s des Großneffen')->sibling()->child()->child()->male(), Relationship::fixed('Großneffe', '%s des Großneffen')->married()->spouse()->sibling()->child()->child()->male(), - // Tante / Onkel + // Tante / Onkel Relationship::fixed('Tante', '%s der Tante')->parent()->sister(), Relationship::fixed('Tante', '%s der Tante')->parent()->brother()->wife(), Relationship::fixed('Onkel', '%s des Onkels')->parent()->sister()->husband(), Relationship::fixed('Onkel', '%s des Onkels')->parent()->brother(), - // Großtante / Großonkel + // Großtante / Großonkel Relationship::fixed('Großtante', '%s der Großtante')->parent()->parent()->sister(), Relationship::fixed('Großtante', '%s der Großtante')->parent()->parent()->brother()->wife(), Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->brother(), Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->sister()->husband(), // Relationships with dynamically generated names - // ancestors: n=2 -> Urgroßmutter (mütterlicherseits) / Großmutter der Mutter + // ancestors: n=2 -> Urgroßmutter (mütterlicherseits) / Großmutter der Mutter Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits)', 1))->mother()->ancestor()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits)', 0))->mother()->ancestor()->male(), Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits)', 1))->father()->ancestor()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits)', 0))->father()->ancestor()->male(), - // + // Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits)', 2))->father()->ancestor(), Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits)', 2))->mother()->ancestor(), - // + // Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sister(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sibling()->wife(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->brother(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->sibling()->husband(), - // descendants + // descendants Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->sibling()->descendant()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->married()->spouse()->sibling()->descendant()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 0))->sibling()->descendant()->male(), From 8f5fa735a1833872904bd27448e4cdce14890006 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 16 May 2025 12:09:43 +0100 Subject: [PATCH 09/13] PSR12 code style --- app/Module/LanguageGerman.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 18229ae91c8..6243e21dbb4 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -60,14 +60,14 @@ protected function normalizeExceptions(): array public function relationships(): array { - // returns array => [nominativ, genitive %s] + // returns array => [nominativ, genitive %s] // $genitive = static fn (string $prefix, string $suffix): array => [$prefix . $suffix, $prefix . 's' . $suffix . '%s']; $genitive = static fn (string $prefix, string $suffix, int $gender): array => ($gender == 0) ? [$prefix . $suffix, '%s' . ' des ' . $prefix . 's' . $suffix] : (($gender == 1) ? [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix] : [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix]); - + // $n <= -1 -> '' - // $n == 0 -> Ur - // $n == 1 -> Urur + // $n == 0 -> Ur + // $n == 1 -> Urur // $n >= 2 -> $n+1 ' x Ur' $ur = static fn (int $n, string $simpleGreat, string $suffix, int $gender): array => $genitive( (($n > 1) ? ($n + 1) . ' x Ur' : (($n > -1) ? 'Ur' . str_repeat('ur', $n) : '')) . $simpleGreat, @@ -164,7 +164,6 @@ public function relationships(): array Relationship::fixed('Großmutter väterlicherseits', '%s der Großmutter (väterlicherseits)')->father()->mother(), Relationship::fixed('Großvater väterlicherseits', '%s des Großvaters (väterlicherseits)')->father()->father(), Relationship::fixed('Großeltern väterlicherseits', '%s der Großeltern (väterlicherseits)')->father()->parent(), - // Relationship::fixed('Großmutter', '%s der Großmutter')->parent()->mother(), Relationship::fixed('Großvater', '%s des Großvaters')->parent()->father(), Relationship::fixed('Großeltern', '%s der Großeltern')->parent()->parent(), From 8356a54438d696162bcd4162ba076c1c9227e343 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 30 May 2025 15:49:28 +0100 Subject: [PATCH 10/13] Update LanguageGerman.php --- app/Module/LanguageGerman.php | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 6243e21dbb4..359ddc3d0d4 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -60,16 +60,16 @@ protected function normalizeExceptions(): array public function relationships(): array { - // returns array => [nominativ, genitive %s] - // $genitive = static fn (string $prefix, string $suffix): array => [$prefix . $suffix, $prefix . 's' . $suffix . '%s']; - $genitive = static fn (string $prefix, string $suffix, int $gender): array => - ($gender == 0) ? [$prefix . $suffix, '%s' . ' des ' . $prefix . 's' . $suffix] : (($gender == 1) ? [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix] : [$prefix . $suffix, '%s' . ' der ' . $prefix . $suffix]); + $genitive = static fn (string $prefix, string $suffix, string $gender): array => [ + $prefix . $suffix, + '%s ' . ($gender === 'M' ? 'des ' . $prefix . 's' : '%s der ' . $prefix) . $suffix, + ] ; // $n <= -1 -> '' // $n == 0 -> Ur // $n == 1 -> Urur // $n >= 2 -> $n+1 ' x Ur' - $ur = static fn (int $n, string $simpleGreat, string $suffix, int $gender): array => $genitive( + $ur = static fn (int $n, string $simpleGreat, string $suffix, string $gender): array => $genitive( (($n > 1) ? ($n + 1) . ' x Ur' : (($n > -1) ? 'Ur' . str_repeat('ur', $n) : '')) . $simpleGreat, $suffix, $gender @@ -195,26 +195,26 @@ public function relationships(): array Relationship::fixed('Großonkel', '%s des Großonkels')->parent()->parent()->sister()->husband(), // Relationships with dynamically generated names // ancestors: n=2 -> Urgroßmutter (mütterlicherseits) / Großmutter der Mutter - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits)', 1))->mother()->ancestor()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits)', 0))->mother()->ancestor()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits)', 1))->father()->ancestor()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits)', 0))->father()->ancestor()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (mütterlicherseits)', 'F'))->mother()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (mütterlicherseits)', 'M'))->mother()->ancestor()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großmutter', ' (väterlicherseits)', 'F'))->father()->ancestor()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großvater', ' (väterlicherseits)', 'M'))->father()->ancestor()->male(), // - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits)', 2))->father()->ancestor(), - Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits)', 2))->mother()->ancestor(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (väterlicherseits)', 'U'))->father()->ancestor(), + Relationship::dynamic(static fn (int $n) => $ur($n - 2, 'großeltern', ' (mütterlicherseits)', 'U'))->mother()->ancestor(), // - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sister(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 1))->ancestor()->sibling()->wife(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->brother(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 0))->ancestor()->sibling()->husband(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 'F'))->ancestor()->sister(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großtante', '', 'F'))->ancestor()->sibling()->wife(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 'M'))->ancestor()->brother(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großonkel', '', 'M'))->ancestor()->sibling()->husband(), // descendants - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->sibling()->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 1))->married()->spouse()->sibling()->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 0))->sibling()->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), '', 0)->married()->spouse()->sibling()->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', '', 1))->descendant()->female(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', '', 0))->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', '', 2))->descendant(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 'F'))->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 'F'))->married()->spouse()->sibling()->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 'M'))->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), '', 'M')->married()->spouse()->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', '', 'F'))->descendant()->female(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', '', 'M'))->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', '', 'U'))->descendant(), ]; } } From 9c95e8161588e18172dad44a74ccb84e409b7997 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 30 May 2025 15:50:25 +0100 Subject: [PATCH 11/13] Update LanguageGerman.php --- app/Module/LanguageGerman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index 359ddc3d0d4..d350372f7f4 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -211,7 +211,7 @@ public function relationships(): array Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 'F'))->sibling()->descendant()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großnichte', '', 'F'))->married()->spouse()->sibling()->descendant()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 'M'))->sibling()->descendant()->male(), - Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe'), '', 'M')->married()->spouse()->sibling()->descendant()->male(), + Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'großneffe', '', 'M'))->married()->spouse()->sibling()->descendant()->male(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin', '', 'F'))->descendant()->female(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkel', '', 'M'))->descendant()->male(), Relationship::dynamic(static fn (int $n) => $ur($n - 3, 'enkelin/enkel', '', 'U'))->descendant(), From 94d92222783fad83358caa920608ac87f5fc0ed4 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 30 May 2025 15:51:31 +0100 Subject: [PATCH 12/13] Update LanguageGerman.php --- app/Module/LanguageGerman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index d350372f7f4..dabde2263ee 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -63,7 +63,7 @@ public function relationships(): array $genitive = static fn (string $prefix, string $suffix, string $gender): array => [ $prefix . $suffix, '%s ' . ($gender === 'M' ? 'des ' . $prefix . 's' : '%s der ' . $prefix) . $suffix, - ] ; + ]; // $n <= -1 -> '' // $n == 0 -> Ur From 85ab4c7877f6029f05eb284b0255aeb75002e12a Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Tue, 3 Jun 2025 11:58:46 +0100 Subject: [PATCH 13/13] Simplify cousin definitions --- app/Module/LanguageGerman.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Module/LanguageGerman.php b/app/Module/LanguageGerman.php index dabde2263ee..94d6ea45215 100644 --- a/app/Module/LanguageGerman.php +++ b/app/Module/LanguageGerman.php @@ -125,11 +125,10 @@ public function relationships(): array Relationship::fixed('Stiefschwester', '%s der Stiefschwester')->parent()->spouse()->daughter(), Relationship::fixed('Stiefbruder', '%s des Stiefbruders')->parent()->spouse()->son(), Relationship::fixed('Stiefgeschwister', '%s der Stiefgeschwister')->parent()->spouse()->child(), - // Cousin / Cousine - Relationship::fixed('Cousine', '%s der Cousine')->parent()->sister()->child()->female(), - Relationship::fixed('Cousine', '%s der Cousine')->parent()->brother()->child()->female(), - Relationship::fixed('Cousin', '%s des Cousins')->parent()->sister()->child()->male(), - Relationship::fixed('Cousin', '%s des Cousins')->parent()->brother()->child()->male(), + // Cousins + Relationship::fixed('Cousin', '%s des Cousins')->parent()->sibling()->son(), + Relationship::fixed('Cousine', '%s der Cousine')->parent()->sibling()->daughter(), + Relationship::fixed('Cousin/Cousine', '%s des Cousins/der Cousine')->parent()->sibling()->child(), // Partners Relationship::fixed('Ex-Frau', '%s der Ex-Frau')->divorced()->partner()->female(), Relationship::fixed('Ex-Mann', '%s des Ex-Mannes')->divorced()->partner()->male(),