MCPcopy
hub / github.com/django/django / get_plural

Method get_plural

django/views/i18n.py:166–178  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 return None
165
166 def get_plural(self):
167 plural = self._plural_string
168 if plural is not None:
169 # This should be a compiled function of a typical plural-form:
170 # Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 :
171 # n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20)
172 # ? 1 : 2;
173 plural = [
174 el.strip()
175 for el in plural.split(";")
176 if el.strip().startswith("plural=")
177 ][0].split("=", 1)[1]
178 return plural
179
180 def get_catalog(self):
181 pdict = {}

Callers 1

get_context_dataMethod · 0.95

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected