1 2 3(function(globals) { 4 5 var django = globals.django || (globals.django = {}); 6 7 8 django.pluralidx = function(count) { return (count == 1) ? 0 : 1; }; 9 10 11 /* gettext library */ 12 13 django.catalog = django.catalog || {}; 14 15 16 if (!django.jsi18n_initialized) { 17 django.gettext = function(msgid) { 18 var value = django.catalog[msgid]; 19 if (typeof(value) == 'undefined') { 20 return msgid; 21 } else { 22 return (typeof(value) == 'string') ? value : value[0]; 23 } 24 }; 25 26 django.ngettext = function(singular, plural, count) { 27 var value = django.catalog[singular]; 28 if (typeof(value) == 'undefined') { 29 return (count == 1) ? singular : plural; 30 } else { 31 return value[django.pluralidx(count)]; 32 } 33 }; 34 35 django.gettext_noop = function(msgid) { return msgid; }; 36 37 django.pgettext = function(context, msgid) { 38 var value = django.gettext(context + '\x04' + msgid); 39 if (value.indexOf('\x04') != -1) { 40 value = msgid; 41 } 42 return value; 43 }; 44 45 django.npgettext = function(context, singular, plural, count) { 46 var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count); 47 if (value.indexOf('\x04') != -1) { 48 value = django.ngettext(singular, plural, count); 49 } 50 return value; 51 }; 52 53 django.interpolate = function(fmt, obj, named) { 54 if (named) { 55 return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); 56 } else { 57 return fmt.replace(/%s/g, function(match){return String(obj.shift())}); 58 } 59 }; 60 61 62 /* formatting library */ 63 64 django.formats = { 65 "DATETIME_FORMAT": "N j, Y, P", 66 "DATETIME_INPUT_FORMATS": [ 67 "%Y-%m-%d %H:%M:%S", 68 "%Y-%m-%d %H:%M:%S.%f", 69 "%Y-%m-%d %H:%M", 70 "%Y-%m-%d", 71 "%m/%d/%Y %H:%M:%S", 72 "%m/%d/%Y %H:%M:%S.%f", 73 "%m/%d/%Y %H:%M", 74 "%m/%d/%Y", 75 "%m/%d/%y %H:%M:%S", 76 "%m/%d/%y %H:%M:%S.%f", 77 "%m/%d/%y %H:%M", 78 "%m/%d/%y" 79 ], 80 "DATE_FORMAT": "N j, Y", 81 "DATE_INPUT_FORMATS": [ 82 "%Y-%m-%d", 83 "%m/%d/%Y", 84 "%m/%d/%y" 85 ], 86 "DECIMAL_SEPARATOR": ".", 87 "FIRST_DAY_OF_WEEK": "0", 88 "MONTH_DAY_FORMAT": "F j", 89 "NUMBER_GROUPING": "3", 90 "SHORT_DATETIME_FORMAT": "m/d/Y P", 91 "SHORT_DATE_FORMAT": "m/d/Y", 92 "THOUSAND_SEPARATOR": ",", 93 "TIME_FORMAT": "P", 94 "TIME_INPUT_FORMATS": [ 95 "%H:%M:%S", 96 "%H:%M:%S.%f", 97 "%H:%M" 98 ], 99 "YEAR_MONTH_FORMAT": "F Y" 100 }; 101 102 django.get_format = function(format_type) { 103 var value = django.formats[format_type]; 104 if (typeof(value) == 'undefined') { 105 return format_type; 106 } else { 107 return value; 108 } 109 }; 110 111 /* add to global namespace */ 112 globals.pluralidx = django.pluralidx; 113 globals.gettext = django.gettext; 114 globals.ngettext = django.ngettext; 115 globals.gettext_noop = django.gettext_noop; 116 globals.pgettext = django.pgettext; 117 globals.npgettext = django.npgettext; 118 globals.interpolate = django.interpolate; 119 globals.get_format = django.get_format; 120 121 django.jsi18n_initialized = true; 122 } 123 124}(this)); 125
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.