[Koha-bugs] [Bug 30729] Template toolkit comments are caught in the translatable strings

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 17 22:22:18 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30729

Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bgkriegel at gmail.com

--- Comment #1 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Many strings are analyzed and extracted using misc/translator/xgettext.pl.
It has a way to detect strings that wants to keep and which to discard.
Normally a line with pure TT ( ^[%.*%]$/ ) is discarded, but it reacts quickly
to anything resembling an HTML tag.

In this case the TT comment 
[%# Display a complex patron search form %]
[%# - Search: <input> %]
[%# You can then pass a list of filters %]
[%# - branch: <select library list> %]
[%# - category: <select patron category list> %]
[%# - search_field: <select patron field list> %]
[%# - search_type: <select "contain" or "start with"> %]
is using things inside <.*>, and poor xgettext.pl is confused.

Changing the comment to
[%# Display a complex patron search form %]
[%# - Search: "input" %]
[%# You can then pass a list of filters %]
[%# - branch: "select library list" %]
[%# - category: "select patron category list" %]
[%# - search_field: "select patron field list" %]
[%# - search_type: "select 'contain' or 'start with'"> %]
eliminates the confusion and preserves, I think, the spirit of the comment, and
fixes the problem.

To test:
cd misc/translator
mkdir test
cp ../../koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc test/.
echo test/patron-search.inc > test.list
./xgettext.pl -f test.list -s -o test.po

The file test.po contains those strange strings, from the comment.
Edit test/patron-search.inc changing the comment as suggested,
repeat the last run and check that the strange strings are gone.

It's either that or teach new skills to xgettext.pl

I haven't been able to find any other cases that didn't come from that file.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list