1 2'use strict'; 3{ 4 const globals = this; 5 const 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 const 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 const value = django.catalog[singular]; 28 if (typeof value === 'undefined') { 29 return (count == 1) ? singular : plural; 30 } else { 31 return value.constructor === Array ? value[django.pluralidx(count)] : value; 32 } 33 }; 34 35 django.gettext_noop = function(msgid) { return msgid; }; 36 37 django.pgettext = function(context, msgid) { 38 let value = django.gettext(context + '\x04' + msgid); 39 if (value.includes('\x04')) { 40 value = msgid; 41 } 42 return value; 43 }; 44 45 django.npgettext = function(context, singular, plural, count) { 46 let value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count); 47 if (value.includes('\x04')) { 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 "%m/%d/%Y %H:%M:%S", 71 "%m/%d/%Y %H:%M:%S.%f", 72 "%m/%d/%Y %H:%M", 73 "%m/%d/%y %H:%M:%S", 74 "%m/%d/%y %H:%M:%S.%f", 75 "%m/%d/%y %H:%M", 76 "%Y-%m-%d" 77 ], 78 "DATE_FORMAT": "N j, Y", 79 "DATE_INPUT_FORMATS": [ 80 "%Y-%m-%d", 81 "%m/%d/%Y", 82 "%m/%d/%y", 83 "%b %d %Y", 84 "%b %d, %Y", 85 "%d %b %Y", 86 "%d %b, %Y", 87 "%B %d %Y", 88 "%B %d, %Y", 89 "%d %B %Y", 90 "%d %B, %Y" 91 ], 92 "DECIMAL_SEPARATOR": ".", 93 "FIRST_DAY_OF_WEEK": 0, 94 "MONTH_DAY_FORMAT": "F j", 95 "NUMBER_GROUPING": 3, 96 "SHORT_DATETIME_FORMAT": "m/d/Y P", 97 "SHORT_DATE_FORMAT": "m/d/Y", 98 "THOUSAND_SEPARATOR": ",", 99 "TIME_FORMAT": "P", 100 "TIME_INPUT_FORMATS": [ 101 "%H:%M:%S", 102 "%H:%M:%S.%f", 103 "%H:%M" 104 ], 105 "YEAR_MONTH_FORMAT": "F Y" 106 }; 107 108 django.get_format = function(format_type) { 109 const value = django.formats[format_type]; 110 if (typeof value === 'undefined') { 111 return format_type; 112 } else { 113 return value; 114 } 115 }; 116 117 /* add to global namespace */ 118 globals.pluralidx = django.pluralidx; 119 globals.gettext = django.gettext; 120 globals.ngettext = django.ngettext; 121 globals.gettext_noop = django.gettext_noop; 122 globals.pgettext = django.pgettext; 123 globals.npgettext = django.npgettext; 124 globals.interpolate = django.interpolate; 125 globals.get_format = django.get_format; 126 127 django.jsi18n_initialized = true; 128 } 129}; 130
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.