-
Notifications
You must be signed in to change notification settings - Fork 32
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Google Translate as MT provider #2637
Conversation
Code Climate has analyzed commit f57e8b2 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 48.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 81.5% (-0.5% change). View more on Code Climate. |
5881b0d
to
11ac7ca
Compare
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
Oh wait, renaming is needed for the command |
8429eca
to
e95bedd
Compare
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
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.
Awesome, I did some testing and found no problems 馃帀
So far as I understood, the credential must be stored somewhere and accessed by the path given in integreat-cms.ini. I'm afraid this might bring security concerns.
It seems like there is the option to do it without a credentials file: https://googleapis.dev/python/google-api-core/latest/auth.html#explicit-credentials
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
I'll squash the commits and resolve conflicts tomorrow. |
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.
Didn't figure out how to inject the credentials but seeing that David already approved, I hope me testing the functionality is not essential.
I found mostly just a few typos, but have a look at my guess about cutting out the credentials file. Maybe it turns out to be right.
Also, we talk about Google Translate in the documentation and the comments, but it's actually called Google Cloud Translate. While I think it makes sense to keep that name facing the user, but I wonder whether it would be less confusing if we called it by the products actual name in the comments and docstrings.
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
integreat_cms/google_translate_api/google_translate_provider.py
Outdated
Show resolved
Hide resolved
integreat_cms/google_translate_api/google_translate_api_client.py
Outdated
Show resolved
Hide resolved
de9ad66
to
7fa6893
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.
Thanks for all the fixes, I think we're all set!
48637dd
to
bd42edc
Compare
Co-authored-by: Tory <115008338+seluianova@users.noreply.github.com> Co-authored-by: David Venhoff <david.venhoff@tuerantuer.org> Co-authored-by: Peter Nerlich <PeterNerlich@users.noreply.github.com>
bd42edc
to
f57e8b2
Compare
Short description
This PR adds Google Translate as an additional machine translation provider.
Currently Google Translate is available only for the languages that are not supported by DeepL. Possibility to choose a provider per language will be introduced in #2586 .
I suggest to add tests separately as #2641 so this PR will not be extremely large after reviews 馃槄
Proposed changes
settings
andintegreat-cms.ini
for Google AuthenticationSide effects
integreat-cms.ini
. I'm afraid this might bring security concerns.check_usage
andtranslatable_attributes
to the classMachineTranslationAPIClient
to avoid duplicates.Resolved issues
Fixes: #1436
Pull Request Review Guidelines