8000 gh-126700: pygettext: Support more gettext functions by tomasr8 · Pull Request #126912 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126700: pygettext: Support more gettext functions #126912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 22, 2024
Prev Previous commit
Next Next commit
Simplify code
  • Loading branch information
tomasr8 committed Nov 17, 2024
commit 3d67a7ac5ec5771bb34a3901d7a0ae73fe452b2f
4 changes: 2 additions & 2 deletions Tools/i18n/pygettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
import tokenize
from collections import defaultdict
from dataclasses import dataclass, field
from operator import attrgetter, itemgetter
from operator import itemgetter

__version__ = '1.6'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bumped the version since this adds some new capabilities, but let me know if it's not needed!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense if the script is separately distributed. But when it is the part of the Python distribution, I think that we should use the Python version. We can discuss this in a separate issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I reverted that change. My original reasoning was that since the version is written to the POT file we might want to bump it up but I agree that it should use the Python version itself, not a separate version.


Expand Down Expand Up @@ -573,7 +573,7 @@ def write(self, fp):

# Sort locations within each message by filename and lineno
sorted_keys = [
(key, sorted(msg.locations, key=attrgetter('filename', 'lineno')))
(key, sorted(msg.locations))
for key, msg in self.__messages.items()
]
# Sort messages by locations
Expand Down
Loading
0