From f460afbad6566e68bdbaddb5577f13f77a86a877 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Tue, 21 Dec 2010 21:42:41 +0100 Subject: [PATCH] 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 --- misc/translator/xgettext.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 031f9ba4e6..abe315e5d7 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -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; -- 2.39.5