Languages tab > Translate not working + no log

More
5 years 3 months ago - 5 years 3 months ago #3364 by benroberts
"Service invoked too many times for one day: translate." is a different error - that one is saying you're over the daily quota limit, the one that was being silently hidden was about the service being called too frequently in a short time span.

The only cause of that *should* be sending too many requests too quickly. But that's not happening with the I2 Loc code (bulk requests get sent as one API call) which is why I think this is a Google bug.

Had no idea you could call translate in the spreadsheet itself ... fun stuff!

edit - that GOOGLETRANSLATE function seems to be pretty broken in Sheets - gives lots of results where the 2nd word in a sentence doesn't get translated, or gets removed completely!
Last edit: 5 years 3 months ago by benroberts.

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #3367 by Frank
Hi,
Thanks for looking into this! There are actually three issues:

1- The Free Tier of google scripts doesn't allow for too many translation requests.
I have been working in improvements to the WebService to allow batching things even better. The editor now only sends 1 call, but currently there are many internal requests, with the new fixes, this is greatly reduced.
This change is a WebService change, so I want to verify it a bit more before releasing it.

2- The Free Tier of google script doesn't allow too many WebService calls in a short time.
Because of this restriction, in game, the WebService Update Frequency is set to Weekly instead of Daily, so that more players can get update without having to wait.
Notice, that its not a problem to have million of users. This just means, that if a million players connect to your game, and they all try to download a new spreadsheet, every hour, only several thousands are going to get updated. The rest will retry again the next time to open the game. So, in very used games, updates to the Spreadhseets, can delay a few days to reach all your users, if a million of them are playing each day.

Now, back to the development part. If the developers are using the same WebService than the players, it can happen that requests made by developers get denied because of too many players are accessing the WebService.
That's why, it is adviceable to have two google accounts with WebServices. You develop using one of the accounts. And when you are ready, switch the url to the other account, and release your game linked to there.
That way, developers can be sure of having all their requests working without delays.

3- When a Translate All fails because of the "too many times" error, the plugin is not handling the retry and error notification. I'm going to release a fix for that in the next beta.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #3369 by benroberts
Hey, thanks for the reply ...

> 1- The Free Tier of google scripts doesn't allow for too many translation requests.

I don't think this is relevant as the error we're seeing 'Translate language fails without error message' *only* happens in the case where the I2Localization code is hiding the "Service invoked too many times in a short time" error from Google.

> 2- The Free Tier of google script doesn't allow too many WebService calls in a short time.

I don't think this is the actual issue either as translating a single term works 100% of the time but trying to bulk translate 150+ for several languages seems to get into a state where it'll fail for one or more languages 100% of the time.

As a way to get this working with as little effort on my part as possible ... I hacked the I2Loc code like this (>100 requests limit enforced):
foreach (var termData in mLanguageSource.mTerms) 
			{
                if (termData.TermType != eTermType.Text)
                    continue;

				if (!string.IsNullOrEmpty(termData.Languages[LanIndex]))
					continue;
				
				string sourceCode, sourceText;
				FindTranslationSource( LanguageSourceData.GetKeyFromFullTerm(termData.Term), termData, code, null, out sourceText, out sourceCode );

				mTranslationTerms.Add (termData.Term);

				GoogleTranslation.CreateQueries(sourceText, sourceCode, googleCode, mTranslationRequests);   // can split plurals into several queries
				
				if (mTranslationRequests.Count >= 100)
				{
					ShowError("100 request limit hit, ignoring more as it can cause a Google service error, re-run translation for this language again!");
					break;
				}
			}

Adding that makes the plugin work again ~90% of the time, just have to keep re-running it, consuming 100 terms at a time. The other 10% it'll also fail with 'too many requests in a short period' but waiting 5 seconds and re-running it then works, unlike before where it would just fail over and over.

I'm sticking with my guess that this is a Google bug ... somewhere around 100 terms in 1 API call seems to be a breaking point that will cause it, well over 100 and it goes from 'might trigger bug' to 'will trigger bug'. If I were in your shoes I'd be contacting Google, from my perspective I can live with the hack solution I put in!

> 3- When a Translate All fails because of the "too many times" error, the plugin is not handling the retry and error notification. I'm going to release a fix for that in the next beta.

Cool.

Please Log in or Create an account to join the conversation.

Time to create page: 0.462 seconds
Template by JoomlaShine