aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-08-17 15:09:42 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-08-17 15:09:42 +0100
commit0a9dd827dd0d36cc56a7e8011ce58efe215e4237 (patch)
treecb3547e7540a2d29baa900318a59d83a99263022 /perllib/FixMyStreet/App.pm
parent72a336a98ade46ee6a96ca111b4ebe18505bd3b9 (diff)
Generalise hostname language overriding.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r--perllib/FixMyStreet/App.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index b29b922dd..fda9d665c 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -160,9 +160,9 @@ sub setup_request {
my $host = $c->req->uri->host;
my $lang =
$lang_override ? $lang_override
- : $host =~ /^en\./ ? 'en-gb'
- : $host =~ /cy/ ? 'cy'
- : undef;
+ : $host =~ /^(..)\./ ? $1
+ : undef;
+ $lang = 'en-gb' if $lang && $lang eq 'en';
# set the language and the translation file to use - store it on stash
my $set_lang = $cobrand->set_lang_and_domain(