#28647: Add support for python-brace-format for variables within {% blocktrans
%}
------------------------------------------------+------------------------
Reporter: Aidas Bendoraitis | Owner: nobody
Type: New feature | Status: new
Component: Internationalization | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Currently with `gettext()` function you can use both, older-style python
format `%(variable)s` and newer style python-brace-format `{variable}`,
for example:
{{{
gettext('Hello, %(addressee)s!') % {'addressee': 'World'}
gettext('Hello, {addressee}!').format(addressee='World')
}}}
Unfortunately, `{% blocktrans %}` always produces the old-style format
with the `%` sign.
I think, it would make sense to add a parameter to the `{% blocktrans %}`
tag by which you could define the python string format you want to
produce.
According to my experience with not-so-technical translators,
`%(variable)s` format in the `django.po` files is more confusing than
`{variable}`.
--
Ticket URL: <https://code.djangoproject.com/ticket/28647>
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/051.372f8756568b6a03f4f2c172ac823ab8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.