Bug 5506 Shorten .po file comment lines

In opac/staff templates .po files, we have comment lines contextualizing
extracted text in templates. Path to template are absolute. For example, we can
have:

  #: /home/katrin/kohaclone/koha-tmpl/intranet-tmpl/prog/en/...
     modules/cataloguing/addbiblio.tmpl:585

The first part of the pathname is useless. With this patch, we just keep
relative path to tempalte from Koha template main directory. The above example
becomes:

  #: intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl:585

To be applied on [3.2]

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit f460afbad6)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Frédéric Demians 2010-12-21 21:42:41 +01:00 committed by Chris Nighswonger
parent 228695c7fe
commit 403eea2c1c
1 changed files with 1 additions and 0 deletions

View File

@ -212,6 +212,7 @@ EOF
for my $token (@{$text{$t}}) {
my $pathname = $token->pathname;
$pathname =~ s/^$directory_re//os;
$pathname =~ s/^.*\/koha-tmpl\/(.*)$/$1/;
printf OUTPUT "#: %s:%d\n", $pathname, $token->line_number
if defined $pathname && defined $token->line_number;
$cformat_p = 1 if $token->type == TmplTokenType::TEXT_PARAMETRIZED;