Opened 3 years ago

Closed 3 years ago

#18760 closed Cleanup/optimization (invalid)

Make gettext and ugettext aliases

Reported by: claudep 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 claudep 3 years ago.
Remove the utf-8-encoded version of gettext

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by claudep

Remove the utf-8-encoded version of gettext

comment:1 Changed 3 years ago by claudep

  • Has patch set

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

comment:2 Changed 3 years ago by Natim87

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 3 years ago by aaugustin

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 3 years ago by claudep

  • Resolution set to invalid
  • Status changed from new to closed

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

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