Closed Bug 600586 Opened 14 years ago Closed 14 years ago

Traceback on themes page

Categories

(Input :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: wenzel, Assigned: wenzel)

References

()

Details

I get traceback emails from our themes page, for the locales zh-CN, nl, fr only from the looks of it. Might be localization-related or a small bug in the themes code.



Traceback (most recent call last):

  File "/data/www/django/input.mozilla.com/reporter/vendor/packages/Django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/django/input.mozilla.com/reporter/vendor/packages/Django/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/data/www/django/input.mozilla.com/reporter/apps/input/decorators.py", line 33, in cached_view
    return f(request, *args, **kwargs)

  File "/data/www/django/input.mozilla.com/reporter/apps/themes/views.py", line 88, in index
    return jingo.render(request, 'themes/index.html', args)

  File "/data/www/django/input.mozilla.com/reporter/vendor/src/jingo/jingo/__init__.py", line 63, in render
    rendered = render_to_string(request, template, context)

  File "/data/www/django/input.mozilla.com/reporter/vendor/src/jingo/jingo/__init__.py", line 84, in render_to_string
    return template.render(**get_context())

  File "/data/www/django/input.mozilla.com/reporter/vendor/packages/jinja2/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/django/input.mozilla.com/reporter/apps/themes/templates/themes/index.html", line 1, in top-level template code
    {% extends "base.html" %}

  File "/data/www/django/input.mozilla.com/reporter/templates/base.html", line 43, in top-level template code
    {% block content %}{% endblock %}

  File "/data/www/django/input.mozilla.com/reporter/apps/themes/templates/themes/index.html", line 26, in block "content"
    {{ theme_list(themes) }}

  File "/data/www/django/input.mozilla.com/reporter/vendor/src/jingo/jingo/__init__.py", line 123, in wrapper
    t = env.get_template(template).render(context)

  File "/data/www/django/input.mozilla.com/reporter/vendor/packages/jinja2/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/django/input.mozilla.com/reporter/apps/themes/templates/themes/theme_list.html", line 14, in top-level template code
    {{ _('{0} similar messages')|f(theme.num_opinions|numberfmt) }}

  File "/data/www/django/input.mozilla.com/reporter/vendor/src/jingo/jingo/helpers.py", line 25, in f
    return string.format(*args, **kwargs)

KeyError: u'count'
I narrowed this down: Apparently these locales have no translations for "{0} similar messages", so gettext suggested something else fuzzily that contains "{count}" and is therefore bogus.

Why fuzzy strings are even considered for translation is a mystery to me. It's the same bug as bug 582911, by the way.
It seems, the SUMO and Input (and zamboni?) compile.sh script called msgfmt with the -f flag, therefore enabling fuzzy translations. That's (almost?) never what we want.

Fixed for Input in http://github.com/fwenzel/reporter-locales/commit/1f012a5 .


QA: If the URL in question does not error out anymore, this is fixed. Untranslated strings are to be expected on the page though (as they caused this in the first place).
Assignee: nobody → fwenzel
Status: NEW → RESOLVED
Closed: 14 years ago
Depends on: 582911
Resolution: --- → FIXED
Target Milestone: --- → 1.9
Verified FIXED; thanks, Fred!
Status: RESOLVED → VERIFIED
Component: Input → General
Product: Webtools → Input
You need to log in before you can comment on or make changes to this bug.