aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App.pm13
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm8
-rw-r--r--perllib/FixMyStreet/Cobrand/EmptyHomes.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/FiksGataMi.pm4
4 files changed, 21 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 825a9f3b3..929889fbd 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -46,6 +46,9 @@ __PACKAGE__->config(
# Start the application
__PACKAGE__->setup();
+# disable debug logging unless in debaug mode
+__PACKAGE__->log->disable('debug') unless __PACKAGE__->debug;
+
=head1 NAME
FixMyStreet::App - Catalyst based application
@@ -106,9 +109,17 @@ sub setup_cobrand {
: undef;
# set the language and the translation file to use - store it on stash
- my $set_lang = $cobrand->set_lang_and_domain( $lang, 1 );
+ my $set_lang = $cobrand->set_lang_and_domain(
+ $lang, # language
+ 1, # return unicode
+ FixMyStreet->path_to('locale')->stringify # use locale directory
+ );
$c->stash->{lang_code} = $set_lang;
+ # debug
+ $c->log->debug( sprintf "Set lang to '%s' and cobrand to '%s'",
+ $set_lang, $cobrand->moniker );
+
Problems::set_site_restriction_with_cobrand_object($cobrand);
Memcached::set_namespace( FixMyStreet->config('BCI_DB_NAME') . ":" );
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index f8ec4a319..fc4581fa1 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -153,17 +153,17 @@ sub enter_postcode_text { '' }
=head2 set_lang_and_domain
- my $set_lang = $cobrand->set_lang_and_domain( $lang, $unicode )
+ my $set_lang = $cobrand->set_lang_and_domain( $lang, $unicode, $dir )
Set the language and domain of the site based on the cobrand and host.
=cut
sub set_lang_and_domain {
- my ( $self, $lang, $unicode ) = @_;
+ my ( $self, $lang, $unicode, $dir ) = @_;
my $set_lang = mySociety::Locale::negotiate_language(
'en-gb,English,en_GB|nb,Norwegian,nb_NO', $lang ); # XXX Testing
- mySociety::Locale::gettext_domain( 'FixMyStreet', $unicode );
+ mySociety::Locale::gettext_domain( 'FixMyStreet', $unicode, $dir );
mySociety::Locale::change();
return $set_lang;
}
@@ -345,7 +345,7 @@ Return the title to be used in page heads.
=cut
-sub site_title { '' }
+sub site_title { 'FixMyStreet.com' }
=head2 on_map_list_limit
diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm
index 934a9cc23..5ebee0d2b 100644
--- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm
+++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm
@@ -37,10 +37,11 @@ Set the language and text domain for the site based on the query and host.
=cut
sub set_lang_and_domain {
- my ( $self, $lang, $unicode ) = @_;
+ my ( $self, $lang, $unicode, $dir ) = @_;
my $set_lang = mySociety::Locale::negotiate_language(
'en-gb,English,en_GB|cy,Cymraeg,cy_GB', $lang );
- mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', $unicode );
+ mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', $unicode,
+ $dir );
mySociety::Locale::change();
return $set_lang;
}
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
index 25a4ad83c..43565d8ea 100644
--- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
+++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
@@ -7,10 +7,10 @@ use warnings;
use Carp;
sub set_lang_and_domain {
- my ( $self, $lang, $unicode ) = @_;
+ my ( $self, $lang, $unicode, $dir ) = @_;
mySociety::Locale::negotiate_language(
'en-gb,English,en_GB|nb,Norwegian,nb_NO', 'nb' );
- mySociety::Locale::gettext_domain( 'FixMyStreet', $unicode );
+ mySociety::Locale::gettext_domain( 'FixMyStreet', $unicode, $dir );
mySociety::Locale::change();
}