diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-02-26 19:23:49 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-02-26 19:23:49 +0000 |
commit | 3e5fa88255ccb7114cd920172cbe66c05b9fff3a (patch) | |
tree | 7d340ddccf38a0c53fcbfe551c6aa4f5045204c5 /perllib/FixMyStreet/DB/ResultSet | |
parent | 8a431b9edb079d095cd3c7e3db391548b1e5d859 (diff) |
Make sure language is set early enough in email alert loop.
The call to set_lang_and_domain needs to happen before
the first string is translated (the report state).
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/AlertType.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index a2784950a..cc4fc67fc 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -58,6 +58,7 @@ sub email_alerts ($) { while (my $row = $query->fetchrow_hashref) { my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->{alert_cobrand})->new(); + $cobrand->set_lang_and_domain( $row->{alert_lang}, 1, FixMyStreet->path_to('locale')->stringify ); # Cobranded and non-cobranded messages can share a database. In this case, the conf file # should specify a vhost to send the reports for each cobrand, so that they don't get sent @@ -204,7 +205,7 @@ sub _send_aggregated_alert_email(%) { my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($data{cobrand})->new(); - $cobrand->set_lang_and_domain( $data{lang}, 1 ); + $cobrand->set_lang_and_domain( $data{lang}, 1, FixMyStreet->path_to('locale')->stringify ); if (!$data{alert_email}) { my $user = FixMyStreet::App->model('DB::User')->find( { |