Forum: Multi-Language Add-In for Visual Studio

Online translation errors

Hi,

I am quite enthusiastic about the new online translation feature, but i am running into errors:

The translation for a language starts fine but after a while (some hundred terms) it stops with a "Service unavailable" error. The error text and part of the log is pasted in below.

A solution could be to start the translation again and have the next hundred terms translated, but as the job seems to start from the very beginning of the project on each run, it will not reach further.

Best regards,
JensBo

Error text:

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at MultiLang.com.microsofttranslator.api.Soap.Translate(String appId, String text, String from, String to) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Web References\com.microsofttranslator.api\Reference.vb:line 176
at MultiLang.ctlToolWindow.MicrosoftTranslator() in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 21461
at MultiLang.ctlToolWindow.cmiLanguageMicrosoftTranslator_Click(Object sender, EventArgs e) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 21526


Log file text:

StoreText ID=-1, IetfTag=sv
StringID -1 not found in GeneralIDs DataTable. Cannot add translation.
StoreText ID=-1, IetfTag=sv
StringID -1 not found in GeneralIDs DataTable. Cannot add translation.
Exception occured: System.Net.WebException
Description: The request failed with HTTP status 503: Service Unavailable.
Additional info: Unhandled error
Stack trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at MultiLang.com.microsofttranslator.api.Soap.Translate(String appId, String text, String from, String to) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Web References\com.microsofttranslator.api\Reference.vb:line 176
at MultiLang.ctlToolWindow.MicrosoftTranslator() in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 21461
at MultiLang.ctlToolWindow.cmiLanguageMicrosoftTranslator_Click(Object sender, EventArgs e) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 21526

Hi again,

As a suggestion it would be nice to be able to call the online translation feature from below the rescan button. Like "Microsoft tranlate MyForm.cs".

In larger projects it seems unnecessary to translate the complete project anew. An too cumbersome to use the F3-key for each item.

Br,
JensBo


Germany

Hi,

I have had the same error, and found that the Add-In doesn't to recover from it (until you restart Visual Studio).

I am not very experienced using Web Services. I think I will have to learn a little more about using them, and handling errors.

Of course, there is a chance that the Web Service at Microsoft starts rejecting requests after being bombarded with lots of (mostly short) translation requests in quick succession. I hope that this is not the case.

By the way, the Add-In only uses the Microsoft Translator for missing translations. If there is already a text in the grid, from whatever source, it will skip over it. Thus, the Add-In appears to start at the beginning again, but it doesn't repeat the same translations.

Phil

Germany

There is apparently a limit applied by the web service, described in this forum posting
MS Translation SOAP Interface Has Transaction Limits?

I think that there are two ways to handle this:

  • combine multiple texts into a single string for translation, so that fewer requests are made to the web service
  • deliberately slow the process down


The discussion in the Microsoft forum indicate that both are possible.

Slowing the process down should be easy to implement, even if it is slightly irritating for users.

Combining multiple texts into one request would be much more programming effort.

Phil

Germany

I have uploaded a new version (4.65.0039) which handles online translation differently.

It now concatenates multiple texts into a single string, using <p> as a separator, and sends them to the Microsoft Translator as a single request. This massively improves performance.

It limits the length of a single block to 1000 characters. You will probably see the progress bar move in large steps, as it sends requests to the web service. It also limits the number of requests to 50 per minute, but this is unlikely to occur in normal operation.

If the text returned from the service does not contain exactly the right number of single strings, the Add-In falls back to the old behaviour and sends each text individually. (In this case it might have to wait after 50 requests.)

Phil


Problem solved.

Was able to translate a project with some 5.000 strings in one go.

Best Regards
JensBo