Bug 6205 - if an include doesn't exist, fall back to en

If a language that doesn't exist gets accessed, then it will fall back
to en for the templates, but not for the includes, so everything still
dies. This allows the process to work in this case too.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

I confirm the bug and the solution. This issue occurs when templates are
partially translated. The main template (.tt) is found for a specific
language, so this language is returned by themetemplate. But in the main
template, some include files (subtemplates) are referenced that can very
well not exist if the translation process had failed to generate them.
This kind of failure is reported by 'translate' script. It's very easy
to miss it, but it's the translator responsability to check it.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Robin Sheat 2011-09-22 15:32:24 +12:00 committed by Chris Cormack
parent 38ca8d6de1
commit 62b76aa98c

View file

@ -55,12 +55,13 @@ sub new {
my ($theme, $lang)= themelanguage( $htdocs, $tmplbase, $interface, $query);
my $template = Template->new(
{
EVAL_PERL => 1,
{ EVAL_PERL => 1,
ABSOLUTE => 1,
INCLUDE_PATH => "$htdocs/$theme/$lang/includes",
INCLUDE_PATH => [
"$htdocs/$theme/$lang/includes",
"$htdocs/$theme/en/includes"
],
FILTERS => {},
}
) or die Template->error();
my $self = {