0

Anyone else experiencing issues with the .net-client for google translate? It seems to be working properly as long as the strings i try to translate are short enough to fit within a GET-request. But when they exceed that and the client tries to do POST-request instead the server returns a http status 404.

With GET-requests it uses: https://www.googleapis.com/language/translate/v2

But with POST-requests uses www.googleapi.com/language/translate/v

If i try to manually go to POST-url in a browser I receive a 404 as well. Bug in the client?

Edit: Found that this was already reported as a bug in their bug tracker a couple of days ago. Due to be included with the next release for the dotnet-client. http://code.google.com/p/google-api-dotnet-client/issues/detail?id=455&can=1&q=translate&colspec=ID%20Type%20Component%20Status%20Priority%20Milestone%20Owner%20Summary

Lars
  • 3
  • 2

2 Answers2

0

We are working on this issue, it is already under review - https://codereview.appspot.com/87170043/. In the meantime you can split the text you want to translate to be no more than around 1950 chars (The library doesn't support more than 2048 chars in a URL).

Take a look at https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis/Apis/Services/BaseClientService.cs#56 and https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Core/Apis/Http/MaxUrlLengthInterceptor.cs

peleyal
  • 3,472
  • 1
  • 14
  • 25
  • Thanks for the quick reply! Do you know when a update of the library is planned to get released to the nuget feed? Will it not affect the quality of the translation if i split the text up to smaller strings instead? Doesn't Google Translate use context to build better translations? – Lars Apr 15 '14 at 07:20
  • Yes, it uses context. A new release with small fixes is plan to be around the beginning of June. I offered you a workaround for the coming weeks, I know that it's not the BEST solution. Sorry :) – peleyal Apr 15 '14 at 14:19
0

That bug was fixed in release 1.8.2. The new NuGet package is available at: http://www.nuget.org/packages/Google.Apis/1.8.2

Read more about it in this blogpost - http://google-api-dotnet-client.blogspot.com/2014/05/announcing-release-of-182.html

peleyal
  • 3,472
  • 1
  • 14
  • 25