appswithlove / statamic-one-click-content-translation

Translate your content in statamic with one click
https://statamic.com/addons/awl/deepl
5 stars 2 forks source link

Any plans to make this compatible with Google Cloud Translate API? #14

Closed diogovitzo closed 6 months ago

diogovitzo commented 6 months ago

Hi,

I'm looking for a Statamic addon such as yours, but unfortunately due to the amount of languages our website supports, DeepL is not a suitable platform. Are there any plans to extend this addon so that it supports Google Cloud Translate API, or even create a different one for that?

If not, I'm willing to give it a try at forking the addon and switching the DeepL integration for Google Could Translate API one, but I figured I'd ask first as it might make business sense for you to do it (at which point I'd immediately buy it)

Thanks!

OleksiiBrylin commented 6 months ago

Hi @diogovitzo

It is good idea to integrate the plugin with Google Cloud Translate API from your side. I think we will extend this addon in nearest future. During 1 month.

diogovitzo commented 6 months ago

Hey @OleksiiBrylin , just wondering if you have an updated ETA? We'd really like to have this available ASAP so we may need to go forward with our integration by next week if you don't choose to do it.

OleksiiBrylin commented 6 months ago

Hi @diogovitzo . I am going to do it in next 3 working days.

diogovitzo commented 6 months ago

@OleksiiBrylin Awesome! Looking forward to it, exciting times!

OleksiiBrylin commented 6 months ago

@diogovitzo new release is available 4.54.0

To use Google Translation service you have to:

  1. update the addon to 4.54.0 or later
  2. update config file with --force flag php artisan vendor:publish --tag="statamic-one-click-content-translation-config" --force or from git repo
  3. generate and set up .env credentials:

ONE_CLICK_CONTENT_TRANSLATION_SERVICE=google ONE_CLICK_CONTENT_TRANSLATION_GOOGLE_APPLICATION_CREDENTIALS= ONE_CLICK_CONTENT_TRANSLATION_GOOGLE_APPLICATION_ID=

  1. test it
diogovitzo commented 6 months ago

Hi @OleksiiBrylin ,

Thank you so much for the quick turnaround! It works (almost!) perfect.

So: after getting the "Done!" success message, the text in textfield isn't replaced by the translated string but only in SOME fields.

Please check this quick recording: https://drive.google.com/file/d/1XGdupAucxoyOr197RI_0jBtw6xybjdTx/view?usp=drivesdk . You will notice that around seconds 0:06-0:10, in the second field that I try to translate, nothing happens. But the others work fine.

Any idea why? I can create a separate issue if you prefer.

OleksiiBrylin commented 6 months ago

Could you click at the code view button and send the screenshot of it?

diogovitzo commented 6 months ago

This one?

https://i.imgur.com/VZXnq9f.png

diogovitzo commented 6 months ago

Also, it seems that Markdown fields aren't supported :(

https://i.imgur.com/tM0vDLH.png

OleksiiBrylin commented 6 months ago

Hey @diogovitzo

I can't reproduce the issue "You will notice that around seconds 0:06-0:10, in the second field that I try to translate". If you still has the same bug, please send me Payload and response from Google DevTools -> Network -> one-click-content-translation request (after you click to translate) -> Payload tab + Response tab

OleksiiBrylin commented 6 months ago

@diogovitzo

"Also, it seems that Markdown fields aren't supported :("

yes, it wasn't supported yet We are planing to enable support of it in 1 week.

diogovitzo commented 6 months ago

Hi @OleksiiBrylin

I can't reproduce the issue (...)

Sure, here they are:

{"selectedLang":"es","defaultLang":"en","texts":[{"index":0,"html":"Download your YouTube Shorts in any file format or quality. Paste your Shorts URL, select format and quality, then download it in a matter of seconds!"}]}

diogovitzo commented 6 months ago

Also,

yes, it wasn't supported yet We are planing to enable support of it in 1 week.

Sure, please do. In the meantime I am going to change it to a bard fieldtype as it will achieve the same result for us, but please do add markdown fieldtype support as I'm sure it'll help us in the future, as well as help others!

OleksiiBrylin commented 6 months ago

I can reproduce the issue. I've created a new issue. You will see when it is fixed "Bard field translations doesn't work if set Character Limit #15 "

diogovitzo commented 6 months ago

Thank you!

OleksiiBrylin commented 6 months ago

@diogovitzo support of Markdown field implemented

diogovitzo commented 6 months ago

@OleksiiBrylin Awesome! Works perfectly thank you!