Skip to content

Commit

Permalink
Tidy the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 7, 2024
1 parent a7ddd27 commit b9d8e44
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -5561,36 +5561,39 @@ sub print_person
if($events[0]->type() ne $events[1]->type()) {
# Simple case - one journey made
$bio->append(journey({ person => $person, arrival => $arrival, departure => $departure }));
if($spouses[0] && ($opts{'l'} || !is_alive(person => $spouses[0]))) {
if(my $sarrival = arrival({ person => $spouses[0] })) {
if($arrival->date()) {
my $with_spouse;
if($spouses[0] && ($opts{'l'} || !is_alive(person => $spouses[0])) &&
(my $sarrival = arrival({ person => $spouses[0] }))) {
if($sarrival->date() eq $arrival->date()) {
$bio->append(i18n(' with ') .
lcfirst($person->possessive()) . ' ' .
(($sex eq 'M') ? 'wife' : 'husband') .
', ' . $spouse->given_names());
$with_spouse++;
}
}
}
my @childnames;
foreach my $child(@children) {
if(($opts{'l'} || !is_alive(person => $child))) {
push(@childnames, $child->given_names());
}
}
if(scalar(@childnames)) {
$bio->append(i18n(' and '));
if(scalar(@childnames) == scalar(@children)) {
$bio->append('all of ' )
->append(lcfirst($person->possessive()))
->append(i18n(' children'));
} elsif(scalar(@childnames) == 1) {
$bio->append(lcfirst($person->possessive()))
->append(i18n(' child '))
->append($childnames[0]);
} elsif(scalar(@childnames) > 1) {
$bio->append(lcfirst($person->possessive()))
->append(i18n(' children'))
->append(': ' . conjunction(@childnames));
my @childnames;
foreach my $child(@children) {
if(($opts{'l'} || !is_alive(person => $child))) {
push(@childnames, $child->given_names());
}
}
if(scalar(@childnames)) {
$bio->append(i18n(($with_spouse) ? ' and ' : ' with '));
if(scalar(@childnames) == scalar(@children)) {
$bio->append('all of ' )
->append(lcfirst($person->possessive()))
->append(i18n(' children'));
} elsif(scalar(@childnames) == 1) {
$bio->append(lcfirst($person->possessive()))
->append(i18n(' child '))
->append($childnames[0]);
} elsif(scalar(@childnames) > 1) {
$bio->append(lcfirst($person->possessive()))
->append(i18n(' children'))
->append(': ' . conjunction(@childnames));
}
}
}
$bio->append('. ');
Expand Down

0 comments on commit b9d8e44

Please sign in to comment.