В настоящее время пытаюсь обновить Django 187 --> 191, но столкнулся с неожиданной проблемой с переводами в моих файлах шаблонов. При первом появлении транс-тега в шаблоне я получаю сообщение об ошибке ниже. Мне кажется, что ugettext не возвращается по умолчанию правильно, когда файл mo/po не найден или не соответствует этой строке (в настоящее время файлы переводов для no/norwegian не используются, поэтому следует просто придерживаться существующего имени).
Все переводы работали корректно долгое время, так что это было неожиданно...
Любые идеи?
NoneType' object has no attribute 'get'
Request Method: GET
Request URL: http://shootnscoreit.com/dashboard/
Django Version: 1.9.1
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'get'
Exception Location: /usr/local/lib/python2.7/gettext.py in ugettext, line 400
...
usr/local/lib/python2.7/gettext.py in ugettext
400. tmsg = self._catalog.get(message, missing)
Local Vars
Variable Value
message u'Armoury'
self <DjangoTranslation lang:no>
missing <object object at 0x7f0e72c00740>
...
File "/home/tss/webapps/shoot_django/lib/python2.7/django/templatetags/i18n.py", line 89, in render
value = render_value_in_context(output, context)
File "/home/tss/webapps/shoot_django/lib/python2.7/django/template/base.py", line 1022, in render_value_in_context
value = force_text(value)
File "/home/tss/webapps/shoot_django/lib/python2.7/django/utils/encoding.py", line 78, in force_text
s = six.text_type(s)
File "/home/tss/webapps/shoot_django/lib/python2.7/django/utils/functional.py", line 114, in __text_cast
return func(*self.__args, **self.__kw)
File "/home/tss/webapps/shoot_django/lib/python2.7/django/utils/translation/__init__.py", line 85, in ugettext
return _trans.ugettext(message)
File "/home/tss/webapps/shoot_django/lib/python2.7/django/utils/translation/trans_real.py", line 318, in ugettext
return do_translate(message, 'ugettext')
File "/home/tss/webapps/shoot_django/lib/python2.7/django/utils/translation/trans_real.py", line 298, in do_translate
result = getattr(translation_object, translation_function)(eol_message)
File "/usr/local/lib/python2.7/gettext.py", line 400, in ugettext
tmsg = self._catalog.get(message, missing)
AttributeError: 'NoneType' object has no attribute 'get'