aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/About.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-08-02 17:29:40 +0100
committerDave Arter <davea@mysociety.org>2017-08-02 17:29:40 +0100
commit26b71d818cf023968e2ee9afd1c4934f57c9111f (patch)
tree41fee314be6a1ced915e6ace0be1a6db7a614279 /perllib/FixMyStreet/App/Controller/About.pm
parentf3994a336c33b585e116674baeb19fd918eb3ab0 (diff)
parent0efa708beb3fcd14413d4ec6d84fbdea76904881 (diff)
Merge branch '1765-localise-about-templates'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/About.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/About.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/About.pm b/perllib/FixMyStreet/App/Controller/About.pm
index 78e548c5f..233da25d3 100755
--- a/perllib/FixMyStreet/App/Controller/About.pm
+++ b/perllib/FixMyStreet/App/Controller/About.pm
@@ -34,22 +34,24 @@ sub index : Path("/about") : Args(0) {
sub find_template : Private {
my ( $self, $c, $page ) = @_;
- return $found{$page} if !FixMyStreet->config('STAGING_SITE') && exists $found{$page};
-
my $lang_code = $c->stash->{lang_code};
+
+ return $found{$lang_code}{$page} if !FixMyStreet->config('STAGING_SITE') &&
+ exists $found{$lang_code}{$page};
+
foreach my $dir_templates (@{$c->stash->{additional_template_paths}}, @{$c->view('Web')->paths}) {
foreach my $dir_static (static_dirs($page, $dir_templates)) {
foreach my $file ("$page-$lang_code.html", "$page.html") {
if (-e "$dir_templates/$dir_static/$file") {
- $found{$page} = "$dir_static/$file";
- return $found{$page};
+ $found{$lang_code}{$page} = "$dir_static/$file";
+ return $found{$lang_code}{$page};
}
}
}
}
# Cache that the page does not exist, so we don't look next time
- $found{$page} = undef;
- return $found{$page};
+ $found{$lang_code}{$page} = undef;
+ return $found{$lang_code}{$page};
}
sub static_dirs {