diff options
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/EmptyHomes.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EmptyHomes.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm index cbecb1c34..c40ea5eb7 100644 --- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm +++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm @@ -30,6 +30,26 @@ sub area_types { return qw(DIS LBO MTD UTA LGD COI); # No CTY } + +sub base_url_with_lang { + my $self = shift; + my $email = shift; + + my $base = $self->base_url; + + if ($email) { + $base = $self->base_url_for_emails; + } + + my $lang = $mySociety::Locale::lang; + if ($lang eq 'cy') { + $base =~ s{http://}{$&cy.}; + } else { + $base =~ s{http://}{$&en.}; + } + return $base; +} + =item set_lang_and_domain LANG UNICODE Set the language and text domain for the site based on the query and host. |