﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26050	translation.activate does not report failure	Michal Čihař	nobody	"Since fix for #25915 (f0a4ff2b118cbc3b7f9ac28a7d9e355288b546c0 in 1.9 branch), the translation.activate can bring translations in non working state, but doesn't report any failure. In past it has silently fallen back to default locale in this case, making the system work, but now it just quite unfriendly and hard to debug error from any gettext call.

Simple test case:

{{{

>>> from django.utils import translation
>>> translation.activate('foo')
>>> translation.gettext('x')
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""/usr/lib/python2.7/dist-packages/django/utils/translation/__init__.py"", line 77, in gettext
    return _trans.gettext(message)
  File ""/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py"", line 312, in gettext
    return do_translate(message, 'gettext')
  File ""/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py"", line 298, in do_translate
    result = getattr(translation_object, translation_function)(eol_message)
  File ""/usr/lib/python2.7/gettext.py"", line 348, in gettext
    tmsg = self._catalog.get(message, missing)
AttributeError: 'NoneType' object has no attribute 'get'
}}}

I think that either translation.activate should fail or fallback to default locale."	Bug	closed	Internationalization	1.9	Normal	duplicate			Unreviewed	0	0	0	0	0	0
