aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Cobrands/Emptyhomes/Util.pm2
-rw-r--r--perllib/Cobrands/Fiksgatami/Util.pm2
-rw-r--r--perllib/Page.pm16
3 files changed, 14 insertions, 6 deletions
diff --git a/perllib/Cobrands/Emptyhomes/Util.pm b/perllib/Cobrands/Emptyhomes/Util.pm
index 00502eae9..d23857f50 100644
--- a/perllib/Cobrands/Emptyhomes/Util.pm
+++ b/perllib/Cobrands/Emptyhomes/Util.pm
@@ -34,7 +34,7 @@ sub admin_base_url {
}
sub area_types {
- return [qw(DIS LBO MTD UTA LGD COI)]; # No CTY
+ return qw(DIS LBO MTD UTA LGD COI); # No CTY
}
=item set_lang_and_domain LANG UNICODE
diff --git a/perllib/Cobrands/Fiksgatami/Util.pm b/perllib/Cobrands/Fiksgatami/Util.pm
index a0374cf1a..9fb448be5 100644
--- a/perllib/Cobrands/Fiksgatami/Util.pm
+++ b/perllib/Cobrands/Fiksgatami/Util.pm
@@ -35,7 +35,7 @@ sub disambiguate_location {
}
sub area_types {
- return [ 'NKO', 'NFY' ];
+ return ( 'NKO', 'NFY' );
}
sub area_min_generation {
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 886c8d994..4281e584b 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -51,6 +51,8 @@ my $lastmodified;
sub do_fastcgi {
my ($func, $lm) = @_;
+ binmode(STDOUT, ":utf8");
+
try {
my $W = new mySociety::WatchUpdate();
while (my $q = new mySociety::Web()) {
@@ -111,7 +113,7 @@ sub microsite {
my $lang;
$lang = 'cy' if $host =~ /cy/;
$lang = 'en-gb' if $host =~ /^en\./;
- Cobrand::set_lang_and_domain(get_cobrand($q), $lang);
+ Cobrand::set_lang_and_domain(get_cobrand($q), $lang, 1);
Problems::set_site_restriction($q);
Memcached::set_namespace(mySociety::Config::get('BCI_DB_NAME') . ":");
@@ -675,10 +677,16 @@ sub mapit_check_error {
}
sub short_name {
- my $name = shift;
+ my ($area, $info) = @_;
# Special case Durham as it's the only place with two councils of the same name
- return 'Durham+County' if ($name eq 'Durham County Council');
- return 'Durham+City' if ($name eq 'Durham City Council');
+ # And some places in Norway
+ return 'Durham+County' if $area->{name} eq 'Durham County Council';
+ return 'Durham+City' if $area->{name} eq 'Durham City Council';
+ if ($area->{name} =~ /^(Os|Nes|V\xe5ler|Sande|B\xf8|Her\xf8y)$/) {
+ my $parent = $info->{$area->{parent_area}}->{name};
+ return "$area->{name},+$parent";
+ }
+ my $name = $area->{name};
$name =~ s/ (Borough|City|District|County) Council$//;
$name =~ s/ Council$//;
$name =~ s/ & / and /;