PageSourceSearch

https://detect.expert/jsi18n/

js detect.expert collected 2026-10-07 21:58:17 UTC 3,702 bytes, 148 lines download raw bytes

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

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.