# This is a hack so that French translation falls back to English translation, # not German translation (which is the default locale and the original # strings). from django.utils.translation import trans_real class MyDjangoTranslation(trans_real.DjangoTranslation): def _add_fallback(self, localedirs=None): if self._DjangoTranslation__language[:2] in {'de', 'en'}: return super()._add_fallback(localedirs) else: # Special case for French if self.domain == 'django': default_translation = trans_real.translation('en_GB') else: default_translation = self.__class__( 'en_GB', domain=self.domain, localedirs=localedirs) self.add_fallback(default_translation) trans_real.DjangoTranslation = MyDjangoTranslation