Bug 15395: Do not process template files that do not use i18n.inc
It should make the string extraction process a little faster For the record, I timed some parts of the process to see why it was so slow, and without surprises the most time-consuming task is the Perl code analysis by PPI with an average time of 50ms by "template block" on my machine. Multiply that by the number of template blocks (approximatively 900), that gives us 45 seconds just for this task. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
d1c6e70b44
commit
ee0c8f319a
1 changed files with 4 additions and 0 deletions
|
@ -527,6 +527,10 @@ sub extract_messages_from_templates {
|
|||
foreach my $file (@files) {
|
||||
say "Extract messages from $file" if $self->{verbose};
|
||||
my $template = read_file("$intranetdir/$file");
|
||||
|
||||
# No need to process a file that doesn't use the i18n.inc file.
|
||||
next unless $template =~ /i18n\.inc/;
|
||||
|
||||
my $data = $parser->parse($template);
|
||||
unless ($data) {
|
||||
warn "Error at $file : " . $parser->error();
|
||||
|
|
Loading…
Reference in a new issue