diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-08-17 15:09:42 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-08-17 15:09:42 +0100 |
commit | 0a9dd827dd0d36cc56a7e8011ce58efe215e4237 (patch) | |
tree | cb3547e7540a2d29baa900318a59d83a99263022 | |
parent | 72a336a98ade46ee6a96ca111b4ebe18505bd3b9 (diff) |
Generalise hostname language overriding.
-rw-r--r-- | perllib/FixMyStreet/App.pm | 6 |
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( |