Skip to content

Wrapped public messages with gettext for i18n support#1829

Merged
davidism merged 2 commits into
pallets:masterfrom
MLH-Fellowship:add-i18n
Apr 3, 2021
Merged

Wrapped public messages with gettext for i18n support#1829
davidism merged 2 commits into
pallets:masterfrom
MLH-Fellowship:add-i18n

Conversation

@Saif807380
Copy link
Copy Markdown
Contributor

Changes made -

  • Wrapped all exceptions
  • Wrapped default help option text
  • Wrapped default prompt text

I'm not sure if __repr__ need to be wrapped.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@Saif807380 Saif807380 force-pushed the add-i18n branch 2 times, most recently from 29f9064 to a9d2c12 Compare April 3, 2021 15:21
Comment thread src/click/core.py Outdated
Comment thread src/click/core.py Outdated
Comment thread src/click/decorators.py Outdated
Comment thread src/click/exceptions.py Outdated
Comment thread src/click/termui.py Outdated
Comment thread src/click/termui.py Outdated
Comment thread src/click/decorators.py Outdated
@davidism davidism force-pushed the add-i18n branch 2 times, most recently from 42e1b6d to 6371b89 Compare April 3, 2021 20:52
@davidism davidism added this to the 8.0.0 milestone Apr 3, 2021
Copy link
Copy Markdown
Member

@ThiefMaster ThiefMaster left a comment

Choose a reason for hiding this comment

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

There may be more cases where we have surrounding whitespace in a translatable string.

Comment thread src/click/_unicodefun.py Outdated
Comment thread src/click/_unicodefun.py Outdated
Comment thread src/click/_unicodefun.py Outdated
Comment thread src/click/exceptions.py
Comment on lines -137 to +147
msg += f". {msg_extra}"
msg += f". {msg_extra}"
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.

I don't think this should be changed. It's common for commandline tools (and other plaintext-based systems) to have two spaces after a colon.

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.

It's been inconsistent across all the projects, I've been standardizing on single space after period for years now. This is the only remaining case of two spaces after a period in Click (excluding old docs and comments).

Comment thread src/click/formatting.py Outdated
@davidism
Copy link
Copy Markdown
Member

davidism commented Apr 3, 2021

Doesn't look like there's surrounding space in any of the messages now.

@davidism davidism merged commit c454226 into pallets:master Apr 3, 2021
@davidism davidism deleted the add-i18n branch April 3, 2021 22:14
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide i18n with gettext

3 participants