Translate whole Language doesn't work: 400 Bad Req
- ArmadaHenrik
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
8 years 6 months ago #1827
by ArmadaHenrik
Replied by ArmadaHenrik on topic Translate whole Language doesn't work: 400 Bad Req
I'm glad you managed to find the issue. I'm sorry I couldn't provide the I2Languages.prefab earlier, so thanks oscarken for the help as well 
If you could let me know as well when the fix is available, that'd be great. Thanks!

If you could let me know as well when the fix is available, that'd be great. Thanks!
Please Log in or Create an account to join the conversation.
8 years 6 months ago #1831
by andrest
Replied by andrest on topic Translate whole Language doesn't work: 400 Bad Req
Hi. We seem to be having the same issue, getting an error when we try to auto-translate a whole language. I sent you an email a couple days ago to the address above, attaching the I2languages.prefab. Please let me know if there's anything we can do to fix this!
We're using v2.6.8f3 of the plugin, Unity v5.4.1p2, on MacOS 10.11.6. This is the error trace:
Unable to access Google or not valid request
UnityEngine.Debug:LogError(Object)
I2.Loc.LocalizationEditor:ShowMessage(String, MessageType, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:205)
I2.Loc.LocalizationEditor:ShowError(String, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:190)
I2.Loc.LocalizationEditor:OnLanguageTranslated(String, String) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Languages.cs:281)
I2.Loc.LocalizationEditor:CheckForConnection() (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Spreadsheet_Google.cs:481)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
We're using v2.6.8f3 of the plugin, Unity v5.4.1p2, on MacOS 10.11.6. This is the error trace:
Unable to access Google or not valid request
UnityEngine.Debug:LogError(Object)
I2.Loc.LocalizationEditor:ShowMessage(String, MessageType, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:205)
I2.Loc.LocalizationEditor:ShowError(String, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:190)
I2.Loc.LocalizationEditor:OnLanguageTranslated(String, String) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Languages.cs:281)
I2.Loc.LocalizationEditor:CheckForConnection() (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Spreadsheet_Google.cs:481)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Please Log in or Create an account to join the conversation.
8 years 6 months ago #1833
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
Replied by Frank on topic Translate whole Language doesn't work: 400 Bad Req
I have been implementing a workaround for this issue.
The problem is that the plugin sends the translation query using the request URL, but if the texts are big, then the maximum of 4K url length is reached and the call fails.
I modified the code to send the data using a POST call instead of a GET call, but google doesn't return the POST data using the same call, instead it creates a one-time address with the result and return it using a redirect. But several versions of unity are not handling redirects fine, and don't even show the LOCATION tag in the response headers, so there is no way to know where to redirect to
So, the solution I'm using now is to fil the original URL until a length of 4K, and that way I can get as many translations as possible in 1 call. But if the source is big enough, google starts failing with the response of "too many queries in a short time", so, I'm now trying to find a balance between how long to wait before calls. I don't want you to have to wait several minutes for all the terms to be processed!
I also added a progress counter, so that it shows how many terms left to be translated!!
Not the best solution, but something around that should work for now. I will send a new beta as soon as I get the final tweaks ready!
Hope that helps,
Frank
The problem is that the plugin sends the translation query using the request URL, but if the texts are big, then the maximum of 4K url length is reached and the call fails.
I modified the code to send the data using a POST call instead of a GET call, but google doesn't return the POST data using the same call, instead it creates a one-time address with the result and return it using a redirect. But several versions of unity are not handling redirects fine, and don't even show the LOCATION tag in the response headers, so there is no way to know where to redirect to

So, the solution I'm using now is to fil the original URL until a length of 4K, and that way I can get as many translations as possible in 1 call. But if the source is big enough, google starts failing with the response of "too many queries in a short time", so, I'm now trying to find a balance between how long to wait before calls. I don't want you to have to wait several minutes for all the terms to be processed!
I also added a progress counter, so that it shows how many terms left to be translated!!
Not the best solution, but something around that should work for now. I will send a new beta as soon as I get the final tweaks ready!
Hope that helps,
Frank
Are you

Are you

To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
Time to create page: 0.126 seconds