Hi,

You don't need bug 20988, you can already use the t() macro to make strings translatable

[% USE Koha %]
[% PROCESS 'i18n.inc' %]

[% catalog_searches = [
     { formid => 'circ_search', label => t('Check out') },
     { formid => 'checkin_search', label => t('Check in') },
     { formid => 'renew_search', label => t('Renew') },
{ formid => 'catalog_search', label => t('Search the catalog'), open => 1 },
] %]

Le 12/07/2020 à 14:19, Katrin Fischer a écrit :
Hi Owen,

I like the idea of centralizing this code a bit more.

I am not sure if bug 20988 will fix the translation issue, but maybe we
could work around it for the time being?

Maybe instead of using [% form.label | html %] we could use the
form.formid and translate that to labels. Then we'd also not have to
repeat the label descriptions in the search definitions for the
different use cases.

Hope that makes sense,

Katrin

On 09.07.20 19:25, Owen Leonard wrote:
I'm playing around with the idea of eliminating all the many search
form include files (serials-search.inc, cat-search.inc,
checking-search.inc, etc.) and replacing them with a single template
which can be processed in different ways.

For instance, in the circulation-home.tt template, "[% INCLUDE
'circ-search.inc' %]" would be replaced with "[% PROCESS
header_searches.inc searches="circulation_searches" %]"

In header_searches.inc (see https://gitlab.com/snippets/1994424), an
array of search forms and their labels would be output according to
the "searches" variable passed to the include file for processing.

Unfortunately this doesn't appear to be translatable, but Bug 20988
might make it possible.

Does this sound like a worthwhile pursuit? A sensible way to leverage
Template toolkit's functionality?

Thanks,

  -- Owen

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

--
Julian Maurice
BibLibre
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to