Opened 12 years ago

Closed 12 years ago

#18760 closed Cleanup/optimization (invalid)

Make gettext and ugettext aliases

Reported by: Claude Paroz Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In Python 3, there is no more gettext/ugettext, only gettext. Aymeric has already aliased ugettext to gettext in recent code when run on Python 3. I would suggest to go one step further and alias them even now on Python 2. I don't see any value to keep a gettext call that returns utf-8 encoded strings.

Attachments (1)

aliased_ugettext.diff (5.1 KB ) - added by Claude Paroz 12 years ago.
Remove the utf-8-encoded version of gettext

Download all attachments as: .zip

Change History (5)

by Claude Paroz, 12 years ago

Attachment: aliased_ugettext.diff added

Remove the utf-8-encoded version of gettext

comment:1 by Claude Paroz, 12 years ago

Has patch: set

Note that I didn't deprecate the ugettext/ungettext names yet. It might not be worth the trouble.

comment:2 by Natim87, 12 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by Aymeric Augustin, 12 years ago

If I understand correctly, this patch is backwards incompatible for people who rely on gettext returning a str on Python 2.

I don't think we can change the behavior of these functions on Python 2 without running into trouble.

comment:4 by Claude Paroz, 12 years ago

Resolution: invalid
Status: newclosed

I wouldn't be as much conservative, but you have a point. Closing.

Note: See TracTickets for help on using tickets.
Back to Top