#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: new
Component: | Version: 1.7
Internationalization |
Severity: Normal | Resolution:
Keywords: trans templatetag | Triage Stage: Accepted
i18n |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by claudep):
The problem with the current solution of doubling percents in `trans`
string content (to prevent msgfmt check errors, as explained in #11240),
is that it's almost impossible to make the reverse operation by replacing
double percents by single ones, because the result is a lazy translation
(and should be kept lazy), hence post-processing the string is not
possible. `blocktrans` does that implicitely during the placeholder
substitution operation (`result % data`).
The only solution I can see currently is to stop doubling percents in
`trans` strings, and document that in case of translation problems, a
translator comment should be added before the string: `# Translators:
xgettext:no-python-format` (to prevent msgfmt from complaining).
--
Ticket URL: <https://code.djangoproject.com/ticket/24257#comment:2>
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.bf1e24afb5e1a265b2b6e10743f2d2ba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.