diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-06-22 18:08:35 -0700 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2020-07-01 10:16:20 +0200 |
| commit | dbae6de01e7cea8d2a7c208213dbb8bffc27ded1 (patch) | |
| tree | 7182008b6f700c5070b83b1946c7a87ae9a63eae /django/views | |
| parent | c2a835703f706583542e9dae82749ac3b92819f8 (diff) | |
Simplified JavaScript with Array.prototype.includes().
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
Diffstat (limited to 'django/views')
| -rw-r--r-- | django/views/i18n.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/views/i18n.py b/django/views/i18n.py index b9aa4ac1d4..c4be394900 100644 --- a/django/views/i18n.py +++ b/django/views/i18n.py @@ -137,7 +137,7 @@ js_catalog_template = r""" django.pgettext = function(context, msgid) { var value = django.gettext(context + '\x04' + msgid); - if (value.indexOf('\x04') != -1) { + if (value.includes('\x04')) { value = msgid; } return value; @@ -145,7 +145,7 @@ js_catalog_template = r""" django.npgettext = function(context, singular, plural, count) { var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count); - if (value.indexOf('\x04') != -1) { + if (value.includes('\x04')) { value = django.ngettext(singular, plural, count); } return value; |
