[Koha-patches] [PATCH] Bug 11588 - Untranslatable subscription frequency units

Owen Leonard oleonard at myacpl.org
Thu Jan 30 16:44:04 CET 2014


The subscription add form has a couple of translation issues which are
addressed in this patch: First, the frequency option which pulls
descriptive strings from the subscription_frequencies table. Second, the
subscription length option which is based on hard-coded choices in
subscription-add.pl.

This patch makes these choices translatable by using a SWITCH in the
template based on the predefined strings which can be expected.

To test, apply the patch and update the translation of your choice by
running 'translate update [language code]'. Confirm that the frequency
and length strings are now present in the updated po file.
---
 .../prog/en/modules/serials/subscription-add.tt    |   42 +++++++++++++++++++-
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
index f206802..1e2bba2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
@@ -658,7 +658,36 @@ $(document).ready(function() {
                                                 [% ELSE %]
                                                     <option value="[% frequency.id %]">
                                                 [% END %]
-                                                    [% frequency.label %]
+                                                    [% SWITCH frequency.label -%]
+                                                        [% CASE "2/day" -%]
+                                                            2/day
+                                                        [% CASE "1/day" -%]
+                                                            1/day
+                                                        [% CASE "3/week" -%]
+                                                            3/week
+                                                        [% CASE "1/week" -%]
+                                                            1/week
+                                                        [% CASE "1/2 weeks" -%]
+                                                            1/2 weeks
+                                                        [% CASE "1/3 weeks" -%]
+                                                            1/3 weeks
+                                                        [% CASE "1/month" -%]
+                                                            1 / month
+                                                        [% CASE "1/2 months" -%]
+                                                            1/2 months
+                                                        [% CASE "1/3 months" -%]
+                                                            1/3 months
+                                                        [% CASE "2/year" -%]
+                                                            2/year
+                                                        [% CASE "1/year" -%]
+                                                            1/year
+                                                        [% CASE "1/2 year" -%]
+                                                            1/2 year
+                                                        [% CASE "Irregular" -%]
+                                                            Irregular
+                                                        [% CASE # default case -%]
+                                                            [% frequency.label %]
+                                                    [% END -%]
                                                 </option>
                                             [% END %]
                                         </select>
@@ -672,7 +701,16 @@ $(document).ready(function() {
                                                 [% ELSE %]
                                                     <option value="[% subt.name %]">
                                                 [% END %]
-                                                    [% subt.name %]
+                                                    [% SWITCH subt.name -%]
+                                                        [% CASE "issues" -%]
+                                                            issues
+                                                        [% CASE "weeks" -%]
+                                                            weeks
+                                                        [% CASE "months" -%]
+                                                            months
+                                                        [% CASE # default case -%]
+                                                            [% subt.name %]
+                                                    [% END -%]
                                                 </option>
                                             [% END %]
                                         </select>
-- 
1.7.9.5


More information about the Koha-patches mailing list