Replaced some hardcoded messages for i18n'ed ones.
This commit is contained in:
parent
2490e166d3
commit
d5079fb2b5
3 changed files with 29 additions and 8 deletions
|
|
@ -424,7 +424,9 @@ sub unsubscribe {
|
|||
#----------------------------------------------------------------------------
|
||||
sub www_confirmMutation {
|
||||
my $self = shift;
|
||||
my ($form, $db) = $self->session->quick( 'form', 'db' );
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
my ($form, $db) = $session->quick( 'form', 'db' );
|
||||
|
||||
my $code = $form->get('code');
|
||||
return unless $code;
|
||||
|
|
@ -438,20 +440,20 @@ sub www_confirmMutation {
|
|||
);
|
||||
|
||||
if ( $userId ) {
|
||||
$self->logConfirmation( $code );
|
||||
|
||||
if ( $type eq 'subscribe' ) {
|
||||
$self->getSubscriptionGroup->addUsers( [ $userId ] );
|
||||
return $self->processStyle( sprintf $i18n->get( 'subscription successful'), $self->getUrl );
|
||||
}
|
||||
elsif ( $type eq 'unsubscribe' ) {
|
||||
$self->getSubscriptionGroup->deleteUsers( [ $userId ] );
|
||||
return $self->processStyle( sprintf $i18n->get( 'unsubscription successful' ), $self->getUrl );
|
||||
}
|
||||
|
||||
$self->logConfirmation( $code );
|
||||
}
|
||||
else {
|
||||
return $self->processStyle( 'Verkeerde code' );
|
||||
}
|
||||
|
||||
return $self->processStyle( 'U bent aangemeld voor deze nieuwsbrief' );
|
||||
return $self->processStyle( $i18n->get( 'wrong code' ) );
|
||||
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -53,6 +53,15 @@ our $I18N = {
|
|||
message => 'Anonieme inschrijvingen zijn niet toegestaan. Log in om in- of uit te schrijven.',
|
||||
},
|
||||
|
||||
'subscription succesful' => {
|
||||
message => 'Uw inschrijving is geslaagd. <a href="%s">Terug naar de site</a>',
|
||||
},
|
||||
'unsubscription succesful' => {
|
||||
message => 'Uw uitschrijving is geslaagd. <a href="%s">Terug naar de site</a>',
|
||||
},
|
||||
'wrong code' => {
|
||||
message => 'De verificatiecode in de link is onbekend, al gebruikt of verlopen. Als u zich wilt in- of uitschrijven probeer dit dan opnieuw of neem contact op met de websitebeheerders.',
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,17 @@ our $I18N = {
|
|||
'anonnymous not allowed' => {
|
||||
message => 'Anonymous subscription is not allowed. Please log in to (un)subscribe',
|
||||
},
|
||||
|
||||
|
||||
'subscription succesful' => {
|
||||
message => 'You are succesfully subscribed. <a href="%s">Back to site</a>',
|
||||
},
|
||||
'unsubscription succesful' => {
|
||||
message => 'You are succesfully unsubscribed. <a href="%s">Back to site</a>',
|
||||
},
|
||||
'wrong code' => {
|
||||
message => 'The verification code you supplied is either unknown, already used or expired. Please try again to (un)subscribe or contact the site administrators.',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue