From 6be7ab7b023f1702f597053830ca848734bf5d28 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Sun, 30 Jun 2024 20:17:58 -0400 Subject: [PATCH] Improve language when someone is living with their adult son after the death of a spouse --- gedcom | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gedcom b/gedcom index 58f5160..7a0db5b 100755 --- a/gedcom +++ b/gedcom @@ -2667,7 +2667,9 @@ sub print_person } } - my @children = map { $_->children() } $person->fams(); + # my @children = map { $_->children() } $person->fams(); + my @children = map { Class::Simple::Readonly::Cached->new({ object => $_, cache => {}, quiet => 1 }) } + map { $_->children() } $person->fams(); my $numberofchildren = scalar(@children); if($opts{'w'} && $numberofchildren) { @@ -5377,7 +5379,7 @@ sub print_person print "\t$type, ", ref($event), "\n", "\t", $event->date(), " $rdate ", $residence->address(), "\n"; } - if((ref($event) eq 'Gedcom::Record') && + if(($event->can('date') || $event->isa('Class::Simple::Readonly::Cached')) && $event->date() && ($event->date() eq $rdate) && $residence->address() && places_are_the_same({ person => $child, first => $residence, second => $event, exact => 1 })) { @@ -5440,6 +5442,16 @@ sub print_person year(date => dateofdeath($spouses[0])); delete $living_with{'daughters'}; } + if($living_with{'sons'}) { + # TODO: more than one son + my @sons = @{$living_with{'sons'}}; + $residencestring .= i18n((scalar(@sons) > 1) ? ' sons, ' : ' son ') . + conjunction(map { given_names($_) } @sons) . ',' . + i18n(' following the death of ') . + (($sex eq 'M') ? 'his wife ' : 'her husband ') . + year(date => dateofdeath($spouses[0])); + delete $living_with{'sons'}; + } if(my $in_law = $living_with{'brother-in-law'}) { # TODO: brothers-in-law $residencestring .= i18n(' brother-in-law, ') . @@ -13452,6 +13464,7 @@ mother::mater sister::soror wife::uxor @@ Spanish +aunt::tia he::él father::padre is::es