[Django] #29151: Aliasing pgettext_lazy makes it work unexpected

3 views
Skip to first unread message

Django

unread,
Feb 22, 2018, 2:44:20 PM2/22/18
to django-...@googlegroups.com
#29151: Aliasing pgettext_lazy makes it work unexpected
------------------------------------------------+------------------------
Reporter: shutterfire | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 2.0
Severity: Normal | Keywords: i18n
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Aliasing pgettext_lazy, e.g. to "_" or "p_" makes it "forget" to create
the msgctxt or to work at all

--
Ticket URL: <https://code.djangoproject.com/ticket/29151>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 23, 2018, 9:54:33 AM2/23/18
to django-...@googlegroups.com
#29151: Aliasing pgettext_lazy makes it work unexpected
-------------------------------------+-------------------------------------

Reporter: shutterfire | Owner: nobody
Type: Bug | Status: new
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution:

Keywords: i18n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I'm not sure how aliasing a function could change its behavior. Are you
sure you haven't made a mistake in your project? Can you provide a failing
test (tests/i18n/tests.py) or a sample project that demonstrates the
issue?

--
Ticket URL: <https://code.djangoproject.com/ticket/29151#comment:1>

Django

unread,
Feb 23, 2018, 7:25:03 PM2/23/18
to django-...@googlegroups.com
#29151: Aliasing pgettext_lazy makes it work unexpected
-------------------------------------+-------------------------------------
Reporter: shutterfire | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution: invalid

Keywords: i18n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => invalid


Comment:

This is a [https://docs.djangoproject.com/en/dev/topics/i18n/translation
/#standard-translation limitation of xgettext],

> Because of how xgettext (used by makemessages) works, only functions
that take a single string argument can be imported as _``:
> * `gettext()`
> * `gettext_lazy()`

--
Ticket URL: <https://code.djangoproject.com/ticket/29151#comment:2>

Reply all
Reply to author
Forward
0 new messages