#19300: capfirst filter breaks translation context in template
-------------------------------------+-------------------------------------
Reporter: dyve | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: trans context | worksforme
capfirst | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by tricoder42):
* status: new => closed
* resolution: => worksforme
Comment:
Hi,
I tried to reproduce this problem, but it works for me:
{{{
# django.po
#: templates/test.html:3 templates/test.html.py:5 templates/test.html.py:6
msgid "species"
msgstr "espèces"
#: templates/test.html:4
msgctxt "singular"
msgid "species"
msgstr "espèce"
}}}
{{{
# test.html
{% load i18n %}
{% trans "species" %}
{% trans "species" context "singular" %}
{% trans "species"|capfirst %}
{% trans "species"|capfirst context "singular" %}
}}}
{{{#!python
# tests.py
from django.template import Context
from django.template.loader import get_template
tmpl = get_template('test.html')
print(tmpl.render(Context({})))
}}}
{{{
# output
espèces
espèce
Espèces
Espèce
}}}
The message catalogue has wrong references for plural "species", but
references are just informational. It doesn't affect the result.
If it still doesn't work for you (tested against 1.7.1 and master), could
you please provide more info to reproduce this bug?
--
Ticket URL: <https://code.djangoproject.com/ticket/19300#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.5ec14aae8d520c896b91e5900613ce21%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.