PageSourceSearch

https://www.zonzofox.com/static/jsi18n/en/djangojs.js

js zonzofox.com collected 2026-10-01 11:51:36 UTC 3,343 bytes, 131 lines download raw bytes

1
2
3'use strict';
4{
5  const globals = this;
6  const django = globals.django || (globals.django = {});
7
8  
9  django.pluralidx = function(count) { return (count == 1) ? 0 : 1; };
10  
11
12  /* gettext library */
13
14  django.catalog = django.catalog || {};
15  
16
17  if (!django.jsi18n_initialized) {
18    django.gettext = function(msgid) {
19      const value = django.catalog[msgid];
20      if (typeof value === 'undefined') {
21        return msgid;
22      } else {
23        return (typeof value === 'string') ? value : value[0];
24      }
25    };
26
27    django.ngettext = function(singular, plural, count) {
28      const value = django.catalog[singular];
29      if (typeof value === 'undefined') {
30        return (count == 1) ? singular : plural;
31      } else {
32        return value.constructor === Array ? value[django.pluralidx(count)] : value;
33      }
34    };
35
36    django.gettext_noop = function(msgid) { return msgid; };
37
38    django.pgettext = function(context, msgid) {
39      let value = django.gettext(context + '\x04' + msgid);
40      if (value.includes('\x04')) {
41        value = msgid;
42      }
43      return value;
44    };
45
46    django.npgettext = function(context, singular, plural, count) {
47      let value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
48      if (value.includes('\x04')) {
49        value = django.ngettext(singular, plural, count);
50      }
51      return value;
52    };
53
54    django.interpolate = function(fmt, obj, named) {
55      if (named) {
56        return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
57      } else {
58        return fmt.replace(/%s/g, function(match){return String(obj.shift())});
59      }
60    };
61
62
63    /* formatting library */
64
65    django.formats = {
66    "DATETIME_FORMAT": "N j, Y, P",
67    "DATETIME_INPUT_FORMATS": [
68      "%Y-%m-%d %H:%M:%S",
69      "%Y-%m-%d %H:%M:%S.%f",
70      "%Y-%m-%d %H:%M",
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 %H:%M:%S",
75      "%m/%d/%y %H:%M:%S.%f",
76      "%m/%d/%y %H:%M",
77      "%Y-%m-%d"
78    ],
79    "DATE_FORMAT": "N j, Y",
80    "DATE_INPUT_FORMATS": [
81      "%Y-%m-%d",
82      "%m/%d/%Y",
83      "%m/%d/%y",
84      "%b %d %Y",
85      "%b %d, %Y",
86      "%d %b %Y",
87      "%d %b, %Y",
88      "%B %d %Y",
89      "%B %d, %Y",
90      "%d %B %Y",
91      "%d %B, %Y"
92    ],
93    "DECIMAL_SEPARATOR": ".",
94    "FIRST_DAY_OF_WEEK": 0,
95    "MONTH_DAY_FORMAT": "F j",
96    "NUMBER_GROUPING": 3,
97    "SHORT_DATETIME_FORMAT": "m/d/Y P",
98    "SHORT_DATE_FORMAT": "m/d/Y",
99    "THOUSAND_SEPARATOR": ",",
100    "TIME_FORMAT": "P",
101    "TIME_INPUT_FORMATS": [
102      "%H:%M:%S",
103      "%H:%M:%S.%f",
104      "%H:%M"
105    ],
106    "YEAR_MONTH_FORMAT": "F Y"
107  };
108
109    django.get_format = function(format_type) {
110      const value = django.formats[format_type];
111      if (typeof value === 'undefined') {
112        return format_type;
113      } else {
114        return value;
115      }
116    };
117
118    /* add to global namespace */
119    globals.pluralidx = django.pluralidx;
120    globals.gettext = django.gettext;
121    globals.ngettext = django.ngettext;
122    globals.gettext_noop = django.gettext_noop;
123    globals.pgettext = django.pgettext;
124    globals.npgettext = django.npgettext;
125    globals.interpolate = django.interpolate;
126    globals.get_format = django.get_format;
127
128    django.jsi18n_initialized = true;
129  }
130};
131

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.