aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm8
-rw-r--r--perllib/FixMyStreet/Cobrand/FixaMinGata.pm3
3 files changed, 8 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 4c2b65979..e5e483937 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -6,7 +6,6 @@ use namespace::autoclean;
$Return::Value::NO_CLUCK = 1;
use Catalyst::Runtime 5.80;
-use DateTime;
use FixMyStreet;
use FixMyStreet::Cobrand;
use Memcached;
@@ -207,9 +206,6 @@ sub setup_request {
# XXX Put in cobrand / do properly
if ($c->cobrand->moniker eq 'zurich') {
FixMyStreet::DB::Result::Problem->visible_states_add_unconfirmed();
- DateTime->DefaultLocale( 'de_CH' );
- } else {
- DateTime->DefaultLocale( 'en_US' );
}
if (FixMyStreet->test_mode) {
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 779c0a7a2..1ba6af139 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -5,6 +5,7 @@ use strict;
use warnings;
use FixMyStreet;
use FixMyStreet::Geocode::Bing;
+use DateTime;
use Encode;
use URI;
use Digest::MD5 qw(md5_hex);
@@ -172,6 +173,13 @@ sub set_lang_and_domain {
my $set_lang = mySociety::Locale::negotiate_language( $languages, $lang_override, $headers );
mySociety::Locale::gettext_domain( $lang_domain, $unicode, $dir );
mySociety::Locale::change();
+
+ if ($mySociety::Locale::langmap{$set_lang}) {
+ DateTime->DefaultLocale( $mySociety::Locale::langmap{$set_lang} );
+ } else {
+ DateTime->DefaultLocale( 'en_US' );
+ }
+
return $set_lang;
}
sub languages { FixMyStreet->config('LANGUAGES') || [ 'en-gb,English,en_GB' ] }
diff --git a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
index dc4b15ed0..98c157aef 100644
--- a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
+++ b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
@@ -9,9 +9,6 @@ use mySociety::MaPit;
use FixMyStreet::Geocode::FixaMinGata;
use DateTime;
-
-DateTime->DefaultLocale('sv_SE');
-
sub site_title {
my ($self) = @_;
return 'FixaMinGata';