Closed Bug 872095 Opened 11 years ago Closed 11 years ago

Flicks Winners page throws exception in Japanese

Categories

(Websites :: Firefox Flicks, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: osmose, Unassigned)

References

()

Details

When visiting the Flicks winners page in the ja locale (https://firefoxflicks.mozilla.org/ja/videos/winners), the following exception is thrown:

Traceback (most recent call last):

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor/lib/python/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/hooks/framework_django.py", line 475, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/videos/views.py", line 47, in winners
    return render(request, 'videos/2013/winners.html', {'datetime': datetime})

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor/lib/python/django/shortcuts/__init__.py", line 44, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor/lib/python/django/template/loader.py", line 176, in render_to_string
    return t.render(context_instance)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor/src/jingo/jingo/__init__.py", line 189, in render
    return super(Template, self).render(context_dict)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/function_trace.py", line 82, in dynamic_wrapper
    return wrapped(*args, **kwargs)

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/videos/templates/videos/2013/winners.html", line 1, in top-level template code
    {% extends 'base.html' %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/base.html", line 1, in top-level template code
    {% extends 'bare.html' %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/bare.html", line 50, in top-level template code
    {% block body %}{% endblock %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/base.html", line 13, in block "body"
    {% block content %}{% endblock %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/videos/templates/videos/2013/winners.html", line 44, in block "content"
    {% trans date='<time datetime="{0}">{1}</time>'|fe(submit_time.isoformat(), submit_time|babel_date) %}

  File "/usr/lib64/python2.6/site-packages/jinja2/_markupsafe/__init__.py", line 98, in __mod__
    return self.__class__(unicode.__mod__(self, arg))

ValueError: unsupported format character '?' (0x63d0) at index 8
I think the offending line is:

#. Describes the date that a video was submitted to the contest.
#: flicks/videos/templates/videos/2013/winners.html:44
#: flicks/videos/templates/videos/2013/winners.html:65
#: flicks/videos/templates/videos/2013/winners.html:86
msgid "Submitted %(date)s"
msgstr "%(date) 提出"

msgstr "%(date)s 提出" 
Fixes the problem but I am not sure why.
Aha! I had looked at that string but missed that it didn't have the s. Good catch!

The s is needed to tell the code to format the value that's inserted there as a string. Sometimes you might put a d or other letter there instead to tell it to format the value as a decimal number or hex number.

kohei or dynamis: Can one of you add the s to the string in verbatim? I can push the site once that's done to update the string on production.
s/提出/投稿/g :)
Updated the translation file. 
http://viewvc.svn.mozilla.org/vc?view=revision&revision=116031

Thank you all.
Fixed in production. Thanks all! 

https://firefoxflicks.mozilla.org/ja/video/winners
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.