diff options
author | Marius Halden <marius.h@lden.org> | 2014-12-31 00:40:36 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2014-12-31 00:40:36 +0100 |
commit | a68037249e6606b4c831322fa28ad7b81af3dcba (patch) | |
tree | a9d194cd71146060d0662f4f29a7e33f1f3deb49 | |
parent | 2df92be2e2cada5236ac2451f8ff6f6085b8e3f8 (diff) |
Update Norwegian cobrand to support both bokmål and nynorsk.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 75d567fee..01ff5d610 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -10,17 +10,25 @@ use FixMyStreet::Geocode::OSM; use DateTime; sub set_lang_and_domain { - my $self = shift; - DateTime->DefaultLocale( 'nb_NO' ); - return $self->SUPER::set_lang_and_domain(@_); + my ( $self, $lang, $unicode, $dir ) = @_; + + if ( $lang != 'nb' && $lang != 'nn' ) + $lang = 'nb'; + + if ( $lang == 'nn' ) + DateTime->DefaultLocale( 'nn_NO' ); + else + DateTime->DefaultLocale( 'nb_NO' ); + + return $self->SUPER::set_lang_and_domain($lang, $unicode, $dir); } sub country { return 'NO'; } -sub languages { [ 'en-gb,English,en_GB', 'nb,Norwegian,nb_NO' ] } -sub language_override { 'nb' } +sub languages { [ 'en-gb,English,en_GB', 'nb,Norwegian,nb_NO', 'nn,Norwegian,nn_NO' ] } +sub language_override { } sub enter_postcode_text { my ( $self ) = @_; |