From ec478e18f352d340c7a1ec4416121928229c2907 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Tue, 30 May 2017 08:41:53 +0200 Subject: [PATCH] Bug 18694: Translatability: Get rid of exposing [%% FOREACH in csv/cash_register_stats.tt Code exposed is: %s %s %s [%%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %%] %s TOTAL [%%- FOREACH field IN total; field; sep IF !loop.last; END %%] Similar for: csv/orders_by_budget.tt To test: - Apply patch - In staff client, verify that Cash register statistics work as before (Home > Reports > Cash register statistics) - Verify the same for Home > Reports > Orders by fund (triggers orders_by_budget.tt) - Bonus test: Create a "language" aa-AA (perl translate create aa-AA from folder misc/translator, verify that lines mentioned above do no longer appear in aa-AA-staff-prog.po ) - Run QA tools (newest version with test for newlines in tt directives) Rebased on top of Bug 18734 2017-12-06 / mv Signed-off-by: Jonathan Druart --- .../en/modules/reports/csv/cash_register_stats.tt | 13 +++---------- .../prog/en/modules/reports/csv/orders_by_budget.tt | 12 +++--------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt index caecb0805b..923a3240fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt @@ -1,14 +1,7 @@ [% USE ItemTypes %] [%- INCLUDE csv_headers/reports/cash_register_stats.tt %] -[%- FOREACH row IN rows %] - [%- FOREACH field IN row; - field IF !loop.last; - ItemTypes.GetDescription(field) IF loop.last; - sep IF !loop.last; - END %] +[%- FOREACH row IN rows # Avoid line breaks in directives because of translatability %] + [%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %] [% END -%] TOTAL -[%- FOREACH field IN total; - field; - sep IF !loop.last; -END %] +[%- FOREACH field IN total; field; sep IF !loop.last; END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/orders_by_budget.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/orders_by_budget.tt index e025c5c5b9..a2b5fd3ef2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/orders_by_budget.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/orders_by_budget.tt @@ -1,12 +1,6 @@ [% INCLUDE csv_headers/reports/orders_by_budget.tt %] -[%- FOREACH row IN rows %] - [%- FOREACH field IN row; - field; - sep IF !loop.last; - END %] +[%- FOREACH row IN rows # Avoid line breaks in directives because of translatability %] + [%- FOREACH field IN row; field; sep IF !loop.last; END %] [% END -%] TOTAL -[%- FOREACH field IN totalrow; - field; - sep IF !loop.last; -END %] +[%- FOREACH field IN totalrow; field; sep IF !loop.last; END %] -- 2.39.5