-
Notifications
You must be signed in to change notification settings - Fork 43
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
Experiments with gettext #328
Conversation
297b10d
to
8107fe4
Compare
8107fe4
to
2681836
Compare
2681836
to
1084105
Compare
1084105
to
4447351
Compare
Remind me what we were waiting for on this PR? I've tested what you have here, and it works as I'd expect it to. Ready for review, or do have more work to do? |
Now that you ask, we should probably see if we can extend this model to external plugins. Edit: I believe this is now possible: |
Another question is whether we can deliver the translations with the python package. Not sure how to test this before actually releasing. Edit: I am sufficiently confident, the translation files (*.mo) are now part of the distribution. Also having the translations in the plugin directory should help to move them around in the future. |
691a537
to
2a5196c
Compare
@ggainey This is ready for review now. |
2a5196c
to
d425c38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the translation files seem kind of empty. What is the process for translating the strings of the CLI?
@@ -1,3 +1,10 @@ | |||
LANGUAGES=de |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only adding German support for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would add them as we go.
# SOME DESCRIPTIVE TITLE. | ||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be filled out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably
plugin_packages = find_namespace_packages( | ||
include=["pulpcore.cli.*"], exclude=["pulpcore.cli.*.*"] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this method think the translation files are packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was listing all submodules too.
@@ -41,7 +42,7 @@ | |||
url="https://github.com/pulp/pulp-cli", | |||
version="0.13.0.dev", | |||
packages=plugin_packages + extra_packages, | |||
package_data={package: ["py.typed"] for package in plugin_packages}, | |||
package_data={"": ["py.typed", "locale/*/LC_MESSAGES/*.mo"]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For loop no longer needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was never needed. Setuptools can handle these wildcard style.
d425c38
to
5b55d75
Compare
It's that time of the Year again, where different versions of black play ping pong with your code. 🏓 Fun! |
Fun! indeed - the PR needs a rebase anyway, will it get Magically Fixed once you do that? |
5b55d75
to
6afa30d
Compare
[noissue]
6afa30d
to
7bd1bca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start - gives us the foundation pieces we need to build on!
No description provided.