aboutsummaryrefslogtreecommitdiffstats
path: root/bin/send-reports
diff options
context:
space:
mode:
authormatthew <matthew>2009-06-09 15:20:35 +0000
committermatthew <matthew>2009-06-09 15:20:35 +0000
commitd5c5589afe07c064d3c7f1ee1916589a5861a2be (patch)
treea0658b978240404082db2985fcfacf658ea2b97f /bin/send-reports
parentf8b534a087ef180713cde433773114a0695cc853 (diff)
Add Locale stuff to reports script.
Diffstat (limited to 'bin/send-reports')
-rwxr-xr-xbin/send-reports14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/send-reports b/bin/send-reports
index 8f7352940..4f38bf4c9 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: send-reports,v 1.67 2009-05-27 15:27:18 matthew Exp $
+# $Id: send-reports,v 1.68 2009-06-09 15:20:35 matthew Exp $
use strict;
require 5.8.0;
@@ -23,6 +23,7 @@ use mySociety::Config;
use mySociety::DBHandle qw(dbh);
use mySociety::Email;
use mySociety::EmailUtil;
+use mySociety::Locale;
use mySociety::MaPit;
use mySociety::Random qw(random_bytes);
use mySociety::Web qw(ent);
@@ -51,6 +52,17 @@ my $base_url = mySociety::Config::get('BASE_URL');
my $site = 'fixmystreet';
$site = 'emptyhomes' if $base_url =~ 'emptyhomes';
+# First, let's pick the right language
+if ($q->{site} eq 'emptyhomes') {
+ mySociety::Locale::negotiate_language('en-gb,English,en_GB|cy,Cymraeg,cy_GB');
+ mySociety::Locale::gettext_domain('FixMyStreet-EmptyHomes');
+ mySociety::Locale::change();
+} else {
+ mySociety::Locale::negotiate_language('en-gb,English,en_GB|nb,Norwegian,nb_NO'); # XXX Testing
+ mySociety::Locale::gettext_domain('FixMyStreet');
+ mySociety::Locale::change();
+}
+
my $query = "SELECT id, council, category, title, detail, name, email, phone,
used_map, easting, northing, (photo is not null) as has_photo
FROM problem WHERE state in ('confirmed','fixed') AND whensent IS NULL