aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-11 10:43:35 +0000
committerMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-11 10:43:35 +0000
commitc8a9805bcb850cab7bf1c1b8c34ef5c4f22e1b73 (patch)
tree9d021c40c9b8927bbc2c237eda0cdd767cbf99de
parentc7662afda971a9d285f70ff625dcd0b170b836e3 (diff)
More EN locales.
-rwxr-xr-xbin/send-reports8
-rw-r--r--perllib/FixMyStreet/Geocode.pm5
-rwxr-xr-xweb/import.cgi6
-rwxr-xr-xweb/index.cgi4
4 files changed, 16 insertions, 7 deletions
diff --git a/bin/send-reports b/bin/send-reports
index 6254337c6..2d5245269 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -104,9 +104,11 @@ foreach my $row (@$unsent) {
if ( mySociety::Config::get('COUNTRY') eq 'GB' ) {
( $h{easting}, $h{northing} ) =
- mySociety::GeoUtil::wgs84_to_national_grid( #
- $h{latitude}, $h{longitude}, 'G'
- );
+ mySociety::Locale::in_gb_locale {
+ mySociety::GeoUtil::wgs84_to_national_grid(
+ $h{latitude}, $h{longitude}, 'G'
+ );
+ };
# email templates don't have conditionals so we need to farmat this here
$h{easting_northing} #
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 355cd827f..9ab958cd9 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -20,6 +20,7 @@ use Cobrand;
use Page;
use mySociety::Config;
use mySociety::GeoUtil;
+use mySociety::Locale;
use mySociety::MaPit;
use mySociety::PostcodeUtil;
use mySociety::Web qw(NewURL);
@@ -62,7 +63,9 @@ sub geocoded_string_coordinates {
$longitude = $1;
$latitude = $2;
try {
- my ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($latitude, $longitude, 'G');
+ my ($easting, $northing) = mySociety::Locale::in_gb_locale {
+ mySociety::GeoUtil::wgs84_to_national_grid($latitude, $longitude, 'G');
+ };
} catch Error::Simple with {
$error = shift;
$error = _('That location does not appear to be in Britain; please try again.')
diff --git a/web/import.cgi b/web/import.cgi
index e7746f589..919f7a653 100755
--- a/web/import.cgi
+++ b/web/import.cgi
@@ -17,6 +17,7 @@ use mySociety::Config;
use mySociety::EmailUtil;
use mySociety::EvEl;
use mySociety::GeoUtil;
+use mySociety::Locale;
sub main {
my $q = shift;
@@ -64,8 +65,9 @@ sub main {
if ( $latitude && mySociety::Config::get('COUNTRY') eq 'GB' ) {
try {
- mySociety::GeoUtil::wgs84_to_national_grid( $latitude, $longitude,
- 'G' );
+ mySociety::Locale::in_gb_locale {
+ mySociety::GeoUtil::wgs84_to_national_grid( $latitude, $longitude, 'G' );
+ };
}
catch Error::Simple with {
my $e = shift;
diff --git a/web/index.cgi b/web/index.cgi
index 2b86c42ae..f5db6e1e7 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -282,7 +282,9 @@ sub submit_problem {
# If in UK and we have a lat,lon coocdinate check it is in UK
if ( $input{latitude} && mySociety::Config::get('COUNTRY') eq 'GB' ) {
try {
- mySociety::GeoUtil::wgs84_to_national_grid($input{latitude}, $input{longitude}, 'G');
+ mySociety::Locale::in_gb_locale {
+ mySociety::GeoUtil::wgs84_to_national_grid($input{latitude}, $input{longitude}, 'G');
+ };
} catch Error::Simple with {
my $e = shift;
push @errors, "We had a problem with the supplied co-ordinates - outside the UK?";