Skip to content

Commit

Permalink
Latest get_params from CGI::Info
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 4, 2024
1 parent 6b06fa6 commit 59b7898
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -11378,7 +11378,7 @@ sub year
} elsif($ENV{'LANG'}) {
$d->set_locale($ENV{'LANG'});
}
return $params->{'circa'} . ' ' . $d->strftime('%b %Y');
return i18n($params->{'circa'}) . ' ' . $d->strftime('%b %Y');
}
return $params->{'circa'} . " $rc";
}
Expand Down Expand Up @@ -14748,6 +14748,8 @@ sub get_language_code

# TODO: format containing ':'
# FIXME: German nouns start with a capital letter
# TODO: investigate Lingua::Translate
# TODO: investigate Locale::Maketext (though I find that overly complex to get started with)
sub i18n
{
my %params;
Expand Down Expand Up @@ -15936,13 +15938,14 @@ sub get_params

# Populate %rc based on the number and type of arguments
if(($num_args == 1) && (defined $default)) {
# %rc = ($default => shift);
return { $default => shift };
} elsif(($num_args % 2) == 0) {
%rc = @_;
} elsif($num_args == 1) {
Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '()');
} elsif($num_args == 0 && defined $default) {
Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '($default => \$val)');
} elsif(($num_args % 2) == 0) {
%rc = @_;
}

return \%rc;
Expand All @@ -15959,6 +15962,7 @@ also::also
also%s::also%s
an %s::an %s
and::and
around::around
arrived::arrived
at::at
aunt::aunt
Expand Down Expand Up @@ -16056,6 +16060,7 @@ also%s::aussi%s
an %s:M:un %s
an %s:F:une %s
and::et
around::environ
arrived:M:est arrivé
arrived:F:est arrivée
at::à
Expand Down Expand Up @@ -16150,6 +16155,7 @@ all with %s::alles mit %s
also::auch
also%s::auch%s
and::und
around::circa
arrived::kam
at::in der
before %s::vor %s
Expand Down

0 comments on commit 59b7898

Please sign in to comment.