diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-11-21 19:15:13 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-12-10 11:51:25 +0000 |
commit | 0d070cca6c534cec77d04b53a1c21325dbdaecfd (patch) | |
tree | fd1f0f207ea5099d48c5509a0bd687f94688735f /perllib/FixMyStreet/Cobrand/Default.pm | |
parent | bd09e5d135aff5abdf01f279b6258bc8cb250f8a (diff) |
Set DefaultLocale appropriately when language set.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 8 |
1 files changed, 8 insertions, 0 deletions
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' ] } |