diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Location.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 3 |
5 files changed, 6 insertions, 22 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm index df8a090c2..c3d754485 100644 --- a/perllib/FixMyStreet/App/Controller/Location.pm +++ b/perllib/FixMyStreet/App/Controller/Location.pm @@ -104,7 +104,7 @@ sub check_location : Private { eval { Utils::convert_latlon_to_en( $c->stash->{latitude}, $c->stash->{longitude} ); }; if (my $error = $@) { mySociety::Locale::pop(); # We threw exception, so it won't have happened. - $error = _('That location does not appear to be in Britain; please try again.') + $error = _('That location does not appear to be in the UK; please try again.') if $error =~ /of the area covered/; $c->stash->{location_error} = $error; return; diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index 71997bfb2..35539ac38 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -15,7 +15,7 @@ sub area_min_generation { 10 } sub enter_postcode_text { my ( $self ) = @_; - return _("Enter a nearby GB postcode, or street name and area"); + return _("Enter a nearby UK postcode, or street name and area"); } sub example_places { @@ -80,7 +80,7 @@ sub geocode_postcode { if ($s =~ /^\d+$/) { return { - error => 'FixMyStreet is a UK-based website that currently works in England, Scotland, and Wales. Please enter either a postcode, or a Great British street name and area.' + error => 'FixMyStreet is a UK-based website. Please enter either a UK postcode, or street name and area.' }; } elsif (mySociety::PostcodeUtil::is_valid_postcode($s)) { my $location = mySociety::MaPit::call('postcode', $s); @@ -96,10 +96,6 @@ sub geocode_postcode { return { error => _("Sorry, that appears to be a Crown dependency postcode, which we don't cover.") }; - } elsif ($island eq 'I') { - return { - error => _("We do not currently cover Northern Ireland, I'm afraid.") - }; } return { latitude => $location->{wgs84_lat}, diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index e5983810b..f2bc1ac95 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -17,9 +17,8 @@ use FixMyStreet::Geocode::OSM; # lookup STRING CONTEXT # Given a user-inputted string, try and convert it into co-ordinates using either # MaPit if it's a postcode, or some web API otherwise. Returns an array of -# data, including an error if there is one (which includes a location being in -# Northern Ireland). The information in the query may be used by cobranded versions -# of the site to diambiguate locations. +# data, including an error if there is one. The information in the query may be +# used by cobranded versions of the site to diambiguate locations. sub lookup { my ($s, $c) = @_; my $data = $c->cobrand->geocode_postcode($s); diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index 13542347d..18e6b56ce 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -52,15 +52,11 @@ sub string { } my $results = $js->{resourceSets}->[0]->{resources}; - my ( $error, @valid_locations, $latitude, $longitude, $ni ); + my ( $error, @valid_locations, $latitude, $longitude ); foreach (@$results) { my $address = $_->{name}; next if $params->{bing_country} && $_->{address}->{countryRegion} ne $params->{bing_country}; - if ($params->{bing_country} eq 'United Kingdom' && $_->{address}{adminDistrict} eq 'Northern Ireland') { - $ni = 1; - next; - } # Getting duplicate, yet different, results from Bing sometimes next if @valid_locations @@ -82,10 +78,6 @@ sub string { push (@valid_locations, $_); } - if ($ni && !scalar @valid_locations) { - return { error => _("We do not currently cover Northern Ireland, I'm afraid.") }; - } - return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1; return { error => $error }; } diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index 0d568f8f1..db3a8ae91 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -62,9 +62,6 @@ sub string { if (!$js) { return { error => _('Sorry, we could not parse that location. Please try again.') }; - } elsif ($js =~ /BT\d/) { - # Northern Ireland, hopefully - return { error => _("We do not currently cover Northern Ireland, I'm afraid.") }; } $js = JSON->new->utf8->allow_nonref->decode($js); |