JavaScript changes to make tmpl_process3 recognize translatable strings.
authoracli <acli>
Wed, 10 Mar 2004 07:38:05 +0000 (07:38 +0000)
committeracli <acli>
Wed, 10 Mar 2004 07:38:05 +0000 (07:38 +0000)
Note: This may break things!

13 files changed:
koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl
koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/aqbookfund.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/aqbudget.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/categorie.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/categoryitem.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/currency.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/itemtypes.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/marctagstructure.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/printers.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/stopwords.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/systempreferences.tmpl
koha-tmpl/intranet-tmpl/default/en/parameters/z3950servers.tmpl

index 45076ee..6cabdd8 100644 (file)
 
 
 <script LANGUAGE="JavaScript">
+function _(s) { return s } // dummy function for gettext
 function active(numlayer)
 {
        for (i=0; i < 10 ; i++ ) {
@@ -500,10 +501,10 @@ function Check(f) {
        var total_errors = total_missing_mandatory_tags + total_missing_mandatory_subfields;
        var alertString2;
        if (total_errors!=0) {
-               alertString2 = "Form not submitted because of the following problem(s)\n";
-               alertString2 += "------------------------------------------------------------------------------------\n\n";
-               alertString2 += "- "+ total_missing_mandatory_tags +" mandatory tags empty\n";
-               alertString2 += "- "+ total_missing_mandatory_subfields +" mandatory fields empty (see bold subfields)";
+               alertString2  = _("Form not submitted because of the following problem(s)");
+               alertString2 += "\n------------------------------------------------------------------------------------\n";
+               alertString2 += "\n- "+ total_missing_mandatory_tags +_(" mandatory tags empty");
+               alertString2 += "\n- "+ total_missing_mandatory_subfields +_(" mandatory fields empty (see bold subfields)");
                alert(alertString2);
        } else {
                document.forms[0].submit();
index accc4f7..50a655c 100644 (file)
@@ -80,6 +80,7 @@
 </center>
 </form>
 <script LANGUAGE="JavaScript">
+function _(s) { return s } // dummy function for gettext
 function active(numlayer)
 {
        for (i=10; i < 11 ; i++ ) {
@@ -112,9 +113,9 @@ function Check(f) {
        if (total_errors==0) {
                document.f.submit();
        } else {
-               alertString2 = "Form not submitted because of the following problem(s)\n";
-               alertString2 += "------------------------------------------------------------------------------------\n\n";
-               alertString2 += "- "+ total_errors+" mandatory fields empty (see bold subfields)";
+               alertString2  = _("Form not submitted because of the following problem(s)");
+               alertString2 += "\n------------------------------------------------------------------------------------\n";
+               alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
                alert(alertString2);
        }
 }
@@ -123,7 +124,7 @@ function Dopop(link,i) {
        newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
 }
 function confirm_deletion(bibid,itemnum) {
-       var is_confirmed = confirm('Do you confirm item deletion ?');
+       var is_confirmed = confirm(_('Do you confirm item deletion?'));
        if (is_confirmed) {
        window.location = "additem.pl?op=delitem&bibid="+bibid+"&itemnum="+itemnum;
        }
index 5c4e207..d2342d7 100644 (file)
@@ -48,6 +48,7 @@
 
 <!-- TMPL_IF name="add_form" -->
 <script>
+       function _(s) { return s } // dummy function for gettext
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
                var _alertString="";
                var alertString2;
                if (f.bookfundid.value.length==0) {
-                       _alertString += "- bookfundid missing\n";
+                       _alertString += "\n- " + _("bookfundid missing";
                }
                if (f.bookfundname.value.length==0) {
-                       _alertString += "- bookfundname missing\n";
+                       _alertString += "\n- " + _("bookfundname missing");
                }
                if (_alertString.length==0) {
                        document.Aform.submit();
                } else {
-                       alertString2 = "Form not submitted because of the following problem(s)\n";
-                       alertString2 += "------------------------------------------------------------------------------------\n\n";
+                       alertString2  = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n";
                        alertString2 += _alertString;
                        alert(alertString2);
                }
index 7768b45..7ad7d46 100644 (file)
@@ -27,6 +27,7 @@
 
 <!-- TMPL_IF name="add_form" -->
 <script>
+       function _(s) { return s } // dummy function for gettext
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
                var _alertString="";
                var alertString2;
                if (!(isNotNull(window.document.Aform.budgetamount,1))) {
-                       _alertString += "- Budget missing\n";
+                       _alertString += "\n- " + _("Budget missing");
                }
                if (_alertString.length==0) {
                        document.Aform.submit();
                } else {
-                       alertString2 = "Form not submitted because of the following problem(s)\n";
-                       alertString2 += "------------------------------------------------------------------------------------\n\n";
+                       alertString2  = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n";
                        alertString2 += _alertString;
                        alert(alertString2);
                }
index 61f00a8..c9f771c 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
        <script>
+       function _(s) { return s } // dummy function for gettext
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
                var _alertString="";
                var alertString2;
                if (f.categorycode.value.length==0) {
-                       _alertString += "- categorycode missing\n";
+                       _alertString += "\n- " + _("categorycode missing");
                }
 //             alert(window.document.Aform.description.value);
                if (!(isNotNull(window.document.Aform.description,1))) {
-                       _alertString += "- description missing\n";
+                       _alertString += "\n- " + _("description missing");
                }
                if (!isNum(f.upperagelimit,0)) {
-                       _alertString += "- upperagelimit is not a number\n";
+                       _alertString += "\n- " + _("upperagelimit is not a number");
                }
                if (_alertString.length==0) {
                        document.Aform.submit();
                } else {
-                       alertString2 = "Form not submitted because of the following problem(s)\n";
-                       alertString2 += "------------------------------------------------------------------------------------\n\n";
+                       alertString2  = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n";
                        alertString2 += _alertString;
                        alert(alertString2);
                }
index 6ec6538..7c5c2c6 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
         <script>
+       function _(s) { return s } // dummy function for gettext
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNotNull(f,noalert) {
                 if (f.value.length ==0) {
                 var _alertString="";
                 var alertString2;
                 if (f.categorycode.value.length==0) {
-                        _alertString += "- categorycode missing\n";
+                        _alertString += "\n- " + _("categorycode missing");
                 }
 //              alert(window.document.Aform.description.value);
                 if (!(isNotNull(window.document.Aform.description,1))) {
-                        _alertString += "- description missing\n";
+                        _alertString += "\n- " + _("description missing");
                 }
                 if (!isNum(f.upperagelimit,0)) {
-                        _alertString += "- upperagelimit is not a number\n";
+                        _alertString += "\n- " + _("upperagelimit is not a number");
                 }
                 if (_alertString.length==0) {
                         document.Aform.submit();
                 } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\n";
-                        alertString2 += "------------------------------------------------------------------------------------\n\n";
+                        alertString2  = _("Form not submitted because of the following problem(s)");
+                        alertString2 += "\n------------------------------------------------------------------------------------\n";
                         alertString2 += _alertString;
                 }
         }
index b074625..a68fc3e 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
         <script>
+       function _(s) { return s } // dummy function for gettext
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNotNull(f,noalert) {
                 if (f.value.length ==0) {
                 var _alertString="";
                 var alertString2;
                 if (f.currency.value.length==0) {
-                        _alertString += "- Currency name missing\\n";
+                        _alertString += "\n- " + _("Currency name missing");
                 }
                 if (f.rate.value.length==0) {
-                        _alertString += "- Rate missing\\n";
+                        _alertString += "\n- " + _("Rate missing");
                 }
                 if (_alertString.length==0) {
                         document.Aform.submit();
                 } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\\n";
-                        alertString2 += "------------------------------------------------------------------------------------\\n\\n";
+                        alertString2  = _("Form not submitted because of the following problem(s)");
+                        alertString2 += "\n------------------------------------------------------------------------------------\n";
                         alertString2 += _alertString;
                         alert(alertString2);
                 }
index a610245..cbbc493 100644 (file)
@@ -1,6 +1,7 @@
 <!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
 
 <script>
+function _(s) { return s } // dummy function for gettext
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 function isNotNull(f,noalert) {
        if (f.value.length ==0) {
@@ -38,22 +39,22 @@ function Check(f) {
        var _alertString="";
        var alertString2;
        if (f.itemtype.value.length==0) {
-               _alertString += "- Itemtype missing\n";
+               _alertString += "\n- " + _("Itemtype missing");
        }
        if (!(isNotNull(window.document.Aform.description,1))) {
-               _alertString += "- Description missing\n";
+               _alertString += "\n- " + _("Description missing");
        }
        if ((!isNum(f.loanlength,0)) && f.loanlength.value.length > 0) {
-               _alertString += "- Loan length is not a number\n";
+               _alertString += "\n- " + _("Loan length is not a number");
        }
        if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
-               _alertString += "- Rental charge is not a number\n";
+               _alertString += "\n- " + _("Rental charge is not a number");
        }
        if (_alertString.length==0) {
                document.Aform.submit();
        } else {
-               alertString2 = "Form not submitted because of the following problem(s)\n";
-               alertString2 += "------------------------------------------------------------------------------------\n\n";
+               alertString2  = _("Form not submitted because of the following problem(s)");
+               alertString2 += "\n------------------------------------------------------------------------------------\n";
                alertString2 += _alertString;
                alert(alertString2);
        }
index 6d5bbe2..3e41786 100644 (file)
@@ -1,6 +1,7 @@
 <!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
 
 <script>
+       function _(s) { return s } // dummy function for gettext
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
                var _alertString="";
                var alertString2;
                if (f.tagfield.value.length==0) {
-                       _alertString += "- tag number missing\n";
+                       _alertString += "\n- " + _("tag number missing");
                }
                if (_alertString.length==0) {
                        document.Aform.submit();
                } else {
-                       alertString2 = "Form not submitted because of the following problem(s)\n";
-                       alertString2 += "------------------------------------------------------------------------------------\n\n";
+                       alertString2  = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n";
                        alertString2 += _alertString;
                        alert(alertString2);
                }
index 4359d6c..d881dc0 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
         <script>
+       function _(s) { return s } // dummy function for gettext
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNotNull(f,noalert) {
                 if (f.value.length ==0) {
                 var _alertString="";
                 var alertString2;
                 if (f.printername.value.length==0) {
-                        _alertString += "- printer name missing\n";
+                        _alertString += "\n- " + _("printer name missing");
                 }
                 if (f.printqueue.value.length==0) {
-                        _alertString += "- Queue missing\n";
+                        _alertString += "\n- " + _("Queue missing");
                 }
                 if (_alertString.length==0) {
                         document.Aform.submit();
                 } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\n";
-                        alertString2 += "------------------------------------------------------------------------------------\n\n";
+                        alertString2  = _("Form not submitted because of the following problem(s)");
+                        alertString2 += "\n------------------------------------------------------------------------------------\n";
                         alertString2 += _alertString;
                         alert(alertString2);
                 }
index 56521c6..194c081 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
         <script>
+       function _(s) { return s } // dummy function for gettext
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNotNull(f,noalert) {
                 if (f.value.length ==0) {
                 var _alertString="";
                 var alertString2;
                 if (f.word.value.length==0) {
-                        _alertString += "- word missing\n";
+                        _alertString += "\n- " + _("word missing");
                 }
                 if (_alertString.length==0) {
                         document.Aform.submit();
                 } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\n";
-                        alertString2 += "------------------------------------------------------------------------------------\n\n";
+                        alertString2  = _("Form not submitted because of the following problem(s)");
+                        alertString2 += "\n------------------------------------------------------------------------------------\n";
                         alertString2 += _alertString;
                         alert(alertString2);
                 }
index dea46f5..adad45b 100644 (file)
@@ -1,6 +1,7 @@
 <!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
 
 <script>
+       function _(s) { return s } // dummy function for gettext
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
                var _alertString="";
                var alertString2;
                if (f.variable.value.length==0) {
-                       _alertString += "- variable missing\n";
+                       _alertString += "\n- " + _("variable missing");
                }
                if (f.value.value.length==0) {
-                       _alertString += "- value missing\n";
+                       _alertString += "\n- " + _("value missing");
                }
                if (_alertString.length==0) {
                        document.Aform.submit();
                } else {
-                       alertString2 = "Form not submitted because of the following problem(s)\n";
-                       alertString2 += "------------------------------------------------------------------------------------\n\n";
+                       alertString2  = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n";
                        alertString2 += _alertString;
                        alert(alertString2);
                }
index 6d080bf..e3f3777 100644 (file)
@@ -2,6 +2,7 @@
 
 <!-- TMPL_IF NAME=add_form -->
         <script>
+       function _(s) { return s } // dummy function for gettext
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         function isNotNull(f,noalert) {
                 if (f.value.length ==0) {
                 var _alertString="";
                 var alertString2;
                 if (f.searchfield.value.length==0) {
-                        _alertString += "- site name missing\n";
+                        _alertString += "\n- " + _("site name missing");
                 }
                 if (f.host.value.length==0) {
-                        _alertString += "- host missing\n";
+                        _alertString += "\n- " + _("host missing");
                 }
                 if (f.port.value.length==0) {
-                        _alertString += "- port missing\n";
+                        _alertString += "\n- " + _("port missing");
                 }
                 if (f.db.value.length==0) {
-                        _alertString += "- database missing\n";
+                        _alertString += "\n- " + _("database missing");
                 }
                 if (isNaN(f.port.value)) {
-                        _alertString += "- port must be a number\n";
+                        _alertString += "\n- " + _("port must be a number");
                 }
                 if (isNaN(f.rank.value)) {
-                        _alertString += "- rank must be a number\n";
+                        _alertString += "\n- " + _("rank must be a number");
                 }
                 if (isNaN(f.checked.value) || f.checked.value<0 || f.checked.value>1) {
-                        _alertString += "- checked must be 0 or 1\n";
+                        _alertString += "\n- " + _("checked must be 0 or 1");
                 }
                 if (_alertString.length==0) {
                         document.Aform.submit();
                 } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\n";
-                        alertString2 += "------------------------------------------------------------------------------------\n\n";
+                        alertString2  = _("Form not submitted because of the following problem(s)");
+                        alertString2 += "\n------------------------------------------------------------------------------------\n";
                         alertString2 += _alertString;
                         alert(alertString2);
                 }