Skip to content

bpo-37785: argparse uses %s in gettext calls causing xgettext warnings#15161

Merged
JulienPalard merged 3 commits into
python:masterfrom
kulikjak:fix-argparse-localization
Sep 13, 2019
Merged

bpo-37785: argparse uses %s in gettext calls causing xgettext warnings#15161
JulienPalard merged 3 commits into
python:masterfrom
kulikjak:fix-argparse-localization

Conversation

@kulikjak

@kulikjak kulikjak commented Aug 7, 2019

Copy link
Copy Markdown
Contributor

Running xgettext on argparse.py (of any currently supported Python 3.x) return following warning:

./Lib/argparse.py: warning: 'msgid' format string with unnamed arguments cannot be properly localized: The translator cannot reorder the arguments. Please consider using a format string with named arguments, and a mapping instead of a tuple for the arguments.

https://bugs.python.org/issue37785

@CuriousLearner CuriousLearner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one minor comment.

Overall looks good.

Comment thread Lib/argparse.py Outdated
Comment thread Lib/argparse.py Outdated
Co-Authored-By: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
Comment thread Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst Outdated

@CuriousLearner CuriousLearner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just modify the NEWS entry. Overall looks good!

Co-Authored-By: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>

@CuriousLearner CuriousLearner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🌮

@kulikjak

Copy link
Copy Markdown
Contributor Author

LGTM

Thanks!

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @kulikjak for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-16080 is a backport of this pull request to the 3.8 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-16081 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 13, 2019
(cherry picked from commit 42671ae)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
miss-islington added a commit that referenced this pull request Sep 13, 2019
(cherry picked from commit 42671ae)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
miss-islington added a commit that referenced this pull request Sep 13, 2019
(cherry picked from commit 42671ae)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
JulienPalard added a commit that referenced this pull request Sep 13, 2019
…6082)

This reverts commit b50eff6 because
it's an incompatible change that would have broken the existing
translations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants