Merge another translation into this catalog.
(self, other)
| 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.""" |
no test coverage detected