HakanL / resxtranslator

Resx Resource Translator
GNU General Public License v2.0
139 stars 30 forks source link

Added google translate #58

Closed jonilviv closed 4 years ago

jonilviv commented 4 years ago

Hi. I added new feature Google Translate. There is dialog, that allow user to select source and target languages. !!! Important !!! Each user should use his own Google API key and using this feature may cost you some money! There is instruction how to setup key https://cloud.google.com/docs/authentication/production#windows

Klocman commented 4 years ago

On a glance everything looks fine. I'll have to clone and test the code when I have a moment. In the meantime here's some things I noticed:

  1. Was the move to .NET 4.8 necessary? By doing this we limit the amount of systems the app can run on out of the box. Unless there's a technical reason for using a newer framework version then the oldest possible should be used.
  2. The google code would ideally be extracted into a separate class to make it easier to add new translation sources in the future, and to make modifying and debugging the code easier.
jonilviv commented 4 years ago
  1. Yes. Google.Cloud.Translation.V2 required .NET 4.7.2. So there is no difference for user between 4.8 and 4.7.2. All old Windows (7, 8.1) should have already installed .NET 4.8. https://support.microsoft.com/en-us/help/4503548/microsoft-net-framework-4-8-offline-installer-for-windows https://docs.microsoft.com/en-us/dotnet/framework/get-started/system-requirements https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies I have a plans to move project to new .NET Core SDK
  2. Yes, this is good idea, but now Google code have just 1 method. I have a plans to add more translations API (Microsoft BING, Yandex and other), so then I will add common API translation interface and I will do refactoring. If you see, how current code can be refactored, please do it, because you is most familiar with whole project, than I.
bastioned commented 3 years ago

Hi mate, I´m having issues running Google Translate module. I have already setup the account on Google, enabled API, and from Google´s console I see failed requests, and this is what appears on the GUI: Google.Apis.Request.RequestError Too many text segments[400] Errors[ Message[Too many text segments] Location[ - ] Reason[invalid] Domain[global] Any ideas?

jonilviv commented 3 years ago

Hi, This is because we use Google.Cloud.Translate.V2 and the list of strings is more than 128 text lines. To solve this we need to upgrade the translation client to Google.Cloud.Translate.V3 and implement batch requests.

вт, 25 трав. 2021 о 11:31 bastioned @.***> пише:

Hi mate, I´m having issues running Google Translate module. I have already setup the account on Google, enabled API, and from Google´s console I see failed requests, and this is what appears on the GUI: Google.Apis.Request.RequestError Too many text segments[400] Errors[ Message[Too many text segments] Location[ - ] Reason[invalid] Domain[global] Any ideas?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HakanL/resxtranslator/pull/58#issuecomment-847713203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDUXQM3LAB5BM2VQ5RUFTTTPNVARANCNFSM4N4WCVBA .

-- Best regards, Ivan Perehynets.

bastioned commented 3 years ago

Thanks for the answer. Any idea when that will happen?

Regards

Obtener BlueMail para Androidhttp://www.bluemail.me/r?b=16925 En 25 may. 2021, en 13:35, jonilviv @.**@.>> escribió:

Hi, This is because we use Google.Cloud.Translate.V2 and the list of strings is more than 128 text lines. To solve this we need to upgrade the translation client to Google.Cloud.Translate.V3 and implement batch requests.

вт, 25 трав. 2021 о 11:31 bastioned @.***> пише:

Hi mate, I´m having issues running Google Translate module. I have already setup the account on Google, enabled API, and from Google´s console I see failed requests, and this is what appears on the GUI: Google.Apis.Request.RequestError Too many text segments[400] Errors[ Message[Too many text segments] Location[ - ] Reason[invalid] Domain[global] Any ideas?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HakanL/resxtranslator/pull/58#issuecomment-847713203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDUXQM3LAB5BM2VQ5RUFTTTPNVARANCNFSM4N4WCVBA .