View | Details | Raw Unified | Return to bug 22490
Collapse All | Expand All

(-)a/cataloguing/value_builder/dateaccessioned.pl (-1 / +1 lines)
Lines 50-56 function Click$function_name(event) { Link Here
50
50
51
function set_to_today( id, force ) {
51
function set_to_today( id, force ) {
52
    /* The force parameter is used in Click but not in Focus ! */
52
    /* The force parameter is used in Click but not in Focus ! */
53
    if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; }
53
    if (! id) { alert(__("Bad id ") + id + __(" sent to set_to_today()")); return 0; }
54
    if (\$("#" + id).val() == '' || force ) {
54
    if (\$("#" + id).val() == '' || force ) {
55
        \$("#" + id).val("$date");
55
        \$("#" + id).val("$date");
56
    }
56
    }
(-)a/cataloguing/value_builder/unimarc_leader.pl (-1 / +1 lines)
Lines 36-42 sub plugin_javascript { Link Here
36
function Blur$function_name(subfield_managed) {
36
function Blur$function_name(subfield_managed) {
37
	var leader_length = document.getElementById(\"$field_number\").value.length;
37
	var leader_length = document.getElementById(\"$field_number\").value.length;
38
    if (leader_length != 24 && leader_length !=0) {
38
    if (leader_length != 24 && leader_length !=0) {
39
        alert(_('leader has an incorrect size: ' + leader_length + ' instead of 24 chars'));
39
        alert(__('leader has an incorrect size: ' + leader_length + ' instead of 24 chars'));
40
    }
40
    }
41
    return 1;
41
    return 1;
42
}
42
}
(-)a/koha-tmpl/intranet-tmpl/js/Gettext.js (-4 / +4 lines)
Lines 35-41 Javascript Gettext - Javascript implemenation of GNU Gettext API. Link Here
35
 var gt = new Gettext(params);
35
 var gt = new Gettext(params);
36
 // create a shortcut if you'd like
36
 // create a shortcut if you'd like
37
 function _ (msgid) { return gt.gettext(msgid); }
37
 function _ (msgid) { return gt.gettext(msgid); }
38
 alert(_("some string"));
38
 alert(__("some string"));
39
 // or use fully named method
39
 // or use fully named method
40
 alert(gt.gettext("some string"));
40
 alert(gt.gettext("some string"));
41
 // change to use a different "domain"
41
 // change to use a different "domain"
Lines 71-77 Javascript Gettext - Javascript implemenation of GNU Gettext API. Link Here
71
     return this.gt.gettext(msgid);
71
     return this.gt.gettext(msgid);
72
 };
72
 };
73
 MyNamespace.MyClass.prototype.something = function () {
73
 MyNamespace.MyClass.prototype.something = function () {
74
     var myString = this._("this will get translated");
74
     var myString = this.__("this will get translated");
75
 };
75
 };
76
76
77
 // //////////////////////////////////////////////////////////
77
 // //////////////////////////////////////////////////////////
Lines 81-87 Javascript Gettext - Javascript implemenation of GNU Gettext API. Link Here
81
 function _ (msgid) {
81
 function _ (msgid) {
82
     return myGettext.gettext(msgid);
82
     return myGettext.gettext(msgid);
83
 }
83
 }
84
 alert( _("text") );
84
 alert( __("text") );
85
85
86
 // //////////////////////////////////////////////////////////
86
 // //////////////////////////////////////////////////////////
87
 // Data structure of the json data
87
 // Data structure of the json data
Lines 1210-1216 It's still recommended to use the statically defined <script ...> method, which Link Here
1210
1210
1211
=item domain support
1211
=item domain support
1212
1212
1213
domain support while using shortcut methods like C<_('string')> or C<i18n('string')>.
1213
domain support while using shortcut methods like C<__('string')> or C<i18n('string')>.
1214
1214
1215
Under normal apps, the domain is usually set globally to the app, and a single language file is used. Under javascript, you may have multiple libraries or applications needing translation support, but the namespace is essentially global.
1215
Under normal apps, the domain is usually set globally to the app, and a single language file is used. Under javascript, you may have multiple libraries or applications needing translation support, but the namespace is essentially global.
1216
1216
(-)a/koha-tmpl/intranet-tmpl/prog/js/authtype.js (-3 / +2 lines)
Lines 41-47 $(document).ready(function() { Link Here
41
        var filename = $(this).val();
41
        var filename = $(this).val();
42
        if ( ! /(?:\.csv|\.ods)$/.test(filename)) {
42
        if ( ! /(?:\.csv|\.ods)$/.test(filename)) {
43
            $(this).css("background-color","yellow");
43
            $(this).css("background-color","yellow");
44
            alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
44
            alert(__("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
45
            $(this).val("");
45
            $(this).val("");
46
            $(this).css("background-color","white");
46
            $(this).css("background-color","white");
47
        }
47
        }
Lines 73-79 $(document).ready(function() { Link Here
73
            }
73
            }
74
        }
74
        }
75
        obj.css("background-color","yellow");
75
        obj.css("background-color","yellow");
76
        alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
76
        alert(__("Please select a CSV (.csv) or ODS (.ods) spreadsheet file."));
77
        obj.val("");
77
        obj.val("");
78
        bj.css("background-color","white");
78
        bj.css("background-color","white");
79
        return false;
79
        return false;
80
- 

Return to bug 22490