From b4a6e237ca6253c9ebef0937987c463397342227 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Fri, 10 Jan 2014 15:46:29 -0500
Subject: [PATCH] [PASSED QA] Bug 11505 - Untranslatable table headers in Label
 batch manager

The label batch manager script hard-codes the table header cell labels
in order to pass them to an HTML-building function. This obviously isn't
the best solution for internationalization, but picking the whole scheme
apart would be very complicated.

Instead this patch uses a SWITCH statement to check for each possible
case and outputs the correct translatable string for each.

To test, apply the patch and run "perl translate update" for any
translation. Check the revised po file and confirm that the new strings
are present. View the label batch edit page and confirm that the table
headings look correct: Tools -> Labels -> Manage batches -> Edit batch.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests.
Similar fixes are probably needed for other pages of the labels
modules.
---
 .../prog/en/modules/labels/label-edit-batch.tt            | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
index bde821a..54ff3bd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
@@ -197,7 +197,20 @@
                                         [% IF ( table_loo.header_fields ) %]
                                         <tr>
                                         [% FOREACH header_field IN table_loo.header_fields %]
-                                            <th>[% header_field.field_label %]</th>
+                                            [% SWITCH header_field.field_label -%]
+                                                [% CASE "Label Number" -%]
+                                                    <th>Label number</th>
+                                                [% CASE "Summary" -%]
+                                                    <th>Summary</th>
+                                                [% CASE "Item Type" %]
+                                                    <th>Item type</th>
+                                                [% CASE "Barcode" %]
+                                                    <th>Barcode</th>
+                                                [% CASE "Select" -%]
+                                                    <th>Select</th>
+                                                [% CASE %]
+                                                    <th>[% header_field.field_label %]</th>
+                                            [% END -%]
                                         [% END %]
                                         </tr>
                                         [% ELSE %]
-- 
1.8.3.2