#33554: Only first translation being found in Jinja handlebars when multiple
strings are defined
-------------------------------------+-------------------------------------
Reporter: Alex Ford | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 3.2
Severity: Normal | Keywords: translations,
| makemessages, jinja, handlebars,
Triage Stage: | multiple strings
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When running makemessages on our project we found some strings were
missing from translations in our Jinja files. After diving into
''utils/translation/template.py'' we found examples of where the
translations were going wrong.
Below is an example of it working:
`{{ _('Hello World') }}` - This works fine and `'Hello World'` is added to
the translatable strings. This example has a token type VAR.
Below are 3 examples of it not working:
`{{ _('Hello World') + _('Foobar') }}` - `'Hello World'` is added to the
translatable strings but `'Foobar'` is not. This example has a token type
VAR. Seems to be only trying to find one word to match with and that's it,
should be finding all possible words.
`{{ foo(_('Hello World'), _('Foobar')) }}` - Exact same as above example.
This is our common use case of this bug.
{{{
{{ _('Hello World') +
_('Foobar') }}
}}}
This example is a bit different as this doesn't find any of the words as
this is seen as a token type TEXT which gets ignored.
--
Ticket URL: <https://code.djangoproject.com/ticket/33554>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107017f59d0d3e5-bf75171f-0151-42df-9a25-765c245be7b6-000000%40eu-central-1.amazonses.com.