MCPcopy
hub / github.com/django/django / merge

Method merge

django/utils/translation/trans_real.py:253–266  ·  view source on GitHub ↗

Merge another translation into this catalog.

(self, other)

Source from the content-addressed store, hash-verified

251 self.add_fallback(default_translation)
252
253 def merge(self, other):
254 """Merge another translation into this catalog."""
255 if not getattr(other, "_catalog", None):
256 return # NullTranslations() has no _catalog
257 if self._catalog is None:
258 # Take plural and _info from first catalog found (generally
259 # Django's).
260 self.plural = other.plural
261 self._info = other._info.copy()
262 self._catalog = TranslationCatalog(other)
263 else:
264 self._catalog.update(other)
265 if other._fallback:
266 self.add_fallback(other._fallback)
267
268 def language(self):
269 """Return the translation language."""

Callers 4

__init__Method · 0.95

Calls 3

TranslationCatalogClass · 0.85
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected