#24257: The trans template tag fails to get a message when there is a %
character
in the string
-------------------------------------+-------------------------------------
Reporter: aboudreault | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 1.7
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: trans templatetag | Triage Stage: Accepted
i18n |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"b7508896fbe19ec2cdeb81565cd587091b6b68d0" b7508896]:
{{{
#!CommitTicketReference repository=""
revision="b7508896fbe19ec2cdeb81565cd587091b6b68d0"
Fixed #24257 -- Corrected i18n handling of percent signs.
Refactored tests to use a sample project.
Updated extraction:
* Removed special handling of single percent signs.
* When extracting messages from template text, doubled all percent signs
so they are not interpreted by gettext as string format flags. All
strings extracted by gettext, if containing a percent sign, will now
be labeled "#, python-format".
Updated translation:
* Used "%%" for "%" in template text before calling gettext.
* Updated {% trans %} rendering to restore "%" from "%%".
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24257#comment:8>
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/069.1b57ab9ea6fcb84911a177ac5bb89b5e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.