If TT code is used in title, alt, value, label, etc. attribute, the code is picked up into the po-files as-is, instead of replacing it with a placeholder. For example: <a href="[% url %]" title="Remove facet [% facet.facet_link_value | html %]">x</a> shows up in the po-files as: msgid "Remove facet [% facet.facet_link_value | html %]"
I asked about this bug on the list [koha-translate]: can we translate things like "Remove facet [% facet.facet_link_value | html %]" to something like "My translation [% facet.facet_link_value | html %]" ... and got following answer from bkriegel: "It's the way I plan to traslate myself :) I tested and it translates Ok" Thanks, Bernardo. I change status to RESOLVED INVALID.
So the translators need to learn TT code? It really should be replaced with a "%s" placeholder, just like all the rest of the TT code in msgid's
I don't tell that this is not a bug, It need to be fixed somehow, I only answered what we can do for now. Status NEW is ok in this case
Created attachment 38618 [details] [review] Bug 12192: Template toolkit code in HTML attributes is picked up into po-files This patch gives a partial solution for this problem. It ignores strings like "[% something %]", but not "[% IF ( value ) %][% value %][% END %]" We get 100+ strings less to translate To test: 1) Update translation files for your preferred language 2) Apply the patch 3) Update again 4) Compare, you must find 100+ strings removed from translation files eg. -msgid "[% SEARCH_RESULT.biblionumber |url %]" -msgid "[% accepteddate | $KohaDates %]" -msgid "[% amountoutstanding | format('%.2f') %]" -msgid "[% authtypetext |html %]" -msgid "[% barcode_llx |html %]" -msgid "[% barcode_lly |html %]" -msgid "[% biblio.quantity.length ? biblio.quantity : 1 %]" -msgid "[% billingdate | $KohaDates %]" -msgid "[% borname |html %]" ...
Created attachment 38646 [details] [review] Bug 12192: Template toolkit code in HTML attributes is picked up into po-files This patch gives a partial solution for this problem. It ignores strings like "[% something %]", but not "[% IF ( value ) %][% value %][% END %]" We get 100+ strings less to translate To test: 1) Update translation files for your preferred language 2) Apply the patch 3) Update again 4) Compare, you must find 100+ strings removed from translation files eg. -msgid "[% SEARCH_RESULT.biblionumber |url %]" -msgid "[% accepteddate | $KohaDates %]" -msgid "[% amountoutstanding | format('%.2f') %]" -msgid "[% authtypetext |html %]" -msgid "[% barcode_llx |html %]" -msgid "[% barcode_lly |html %]" -msgid "[% biblio.quantity.length ? biblio.quantity : 1 %]" -msgid "[% billingdate | $KohaDates %]" -msgid "[% borname |html %]" ... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 38713 [details] [review] Bug 12192: Template toolkit code in HTML attributes is picked up into po-files This patch gives a partial solution for this problem. It ignores strings like "[% something %]", but not "[% IF ( value ) %][% value %][% END %]" We get 100+ strings less to translate To test: 1) Update translation files for your preferred language 2) Apply the patch 3) Update again 4) Compare, you must find 100+ strings removed from translation files eg. -msgid "[% SEARCH_RESULT.biblionumber |url %]" -msgid "[% accepteddate | $KohaDates %]" -msgid "[% amountoutstanding | format('%.2f') %]" -msgid "[% authtypetext |html %]" -msgid "[% barcode_llx |html %]" -msgid "[% barcode_lly |html %]" -msgid "[% biblio.quantity.length ? biblio.quantity : 1 %]" -msgid "[% billingdate | $KohaDates %]" -msgid "[% borname |html %]" ... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Verified all strings removed from the po files were pure TT.
Great improvement Bernardo. Thanks! Pushed to master.
Pushed to 3.18.x will be in 3.18.7