@@ -, +, @@ calculation --- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 8 ++++---- members/moremember.pl | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -154,7 +154,7 @@ var dob = new Date($("#dateofbirth").datepicker( 'getDate' )); var year = dob.getFullYear(); - var month = dob.getMonth(); + var month = dob.getMonth() + 1; var day = dob.getDate(); $.ajax({ @@ -163,9 +163,9 @@ data: 'dateofbirth=' + year + '-' + month + '-' + day, dataType: 'json', success : function(json, statut){ - var age_string = "Age: "; - if (json.years) { age_string += json.years + " year(s) "; } - if (json.months) { age_string += json.months + " month(s) "; } + var age_string = _('Age: '); + if (json.years) { age_string += json.years + _(' year(s) '); } + if (json.months) { age_string += json.months + _(' month(s)'); } var elem = $("#dateofbirth").siblings(".hint").first().html(age_string); }, }); --- a/members/moremember.pl +++ a/members/moremember.pl @@ -61,6 +61,7 @@ if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen use DateTime; use Koha::DateUtils; use Koha::Database; +use Koha::I18N; use vars qw($debug); @@ -141,8 +142,8 @@ $data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' ); my @age; my ($years, $months) = GetAge($data->{dateofbirth}); -push @age, "$years year(s)" if $years; -push @age, "$months month(s)" if $months; +push @age, $years . gettext(' year(s)') if $years; +push @age, $months . gettext(' month(s)') if $months; $template->param( age => join(', ', @age) ); for (qw(gonenoaddress lost borrowernotes)) { --