Skip to content

Commit

Permalink
Improve language when someone is living with their adult son after th…
Browse files Browse the repository at this point in the history
…e death of a spouse
  • Loading branch information
nigelhorne committed Jul 1, 2024
1 parent 1e27259 commit 6be7ab7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 })) {
Expand Down Expand Up @@ -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, ') .
Expand Down Expand Up @@ -13452,6 +13464,7 @@ mother::mater
sister::soror
wife::uxor
@@ Spanish
aunt::tia
he::él
father::padre
is::es
Expand Down

0 comments on commit 6be7ab7

Please sign in to comment.