Opened 4 years ago

Closed 4 years ago

#18760 closed Cleanup/optimization (invalid)

Make gettext and ugettext aliases

Reported by: Claude Paroz Owned by: nobody
Component: Internationalization Version: master
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 4 years ago.
Remove the utf-8-encoded version of gettext

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by Claude Paroz

Attachment: aliased_ugettext.diff added

Remove the utf-8-encoded version of gettext

comment:1 Changed 4 years ago by Claude Paroz

Has patch: set

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

comment:2 Changed 4 years ago by Natim87

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 4 years ago by Aymeric Augustin

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 Changed 4 years ago by Claude Paroz

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