Bug 7738: "Display more constraints' in subfield configuraiton is not properly transl...
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Mon, 19 Mar 2012 15:05:55 +0000 (16:05 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 22 Mar 2012 08:04:53 +0000 (09:04 +0100)
The Javascript toggling the link description was checking for the english
link text. This would not work for translated templates.

Tested: Apply patch, then translate update and translate install.
Text changes as appropriate (with manually inserted translation in .po file)

Signed-off-by: mveron <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt

index c196300..a5357d8 100644 (file)
@@ -5,17 +5,19 @@
 <script type="text/javascript">
 //<![CDATA[
 
-        $(document).ready(function() {
-               $('#subfieldtabs > ul').tabs();
-               $("a.displaymore").click(function(){
-                       $("#"+$(this).attr("href").replace("#","")).toggle();
-                       if($(this).html() == "display more constraints"){
-                               $(this).html("hide constraints");
-                       } else {
-                               $(this).html("display more constraints");
-                       }
-               });
-        });
+$(document).ready(function() {
+    $('#subfieldtabs > ul').tabs();
+        $("a.displaymore").click(function(){
+        var link = $(this);
+        var constraints = $("#"+$(this).attr("href").replace("#",""));
+        constraints.toggle();
+            if($(constraints).is(':visible')){
+                link.html(_("Hide constraints"));
+            } else {
+                link.html(_("Display more constraints"));
+            }
+    });
+});
 
 /*function displayMoreConstraint(numlayer){
     var thisdiv = document.getElementById(numlayer);
                        </ol>
             </fieldset>
                        
-            <a class="displaymore" href="#more[% loo.urisubfieldcode %]">display more constraints</a>
+            <a class="displaymore" href="#more[% loo.urisubfieldcode %]">Display more constraints</a>
             <div id="more[% loo.urisubfieldcode %]" style="display:none; clear: both">
              <fieldset class="rows" style="float:none;">
                                <legend>Advanced constraints:</legend>