SA.Rainbomizer
SA.Rainbomizer copied to clipboard
DYOM Missions Translation
This feature automatically translates (or, at least, attempts to) mission loaded by DYOM Randomizer from any language supported by Google Translate to English.
Hey,
Thanks for your contribution. We are working on new features including an auto-translate tool as well, and this pull request would conflict with those updates.
It does help with the translation portion of the process though, so I have a few questions regarding that it seems you are making requests for each objective text, which could go up to 100 objectives = 100 requests in a short span of time. Does the trigger some sort of captcha or similar rate prevention issue?
And in regards to editing the dat file, we have a well documented structure for the dat files that I feel might be better to use than manipulating arrays.
Hey @Parik27 ,
Good to know that you are already working on this feature.
I did some tests with external tools sending 100 requests effectively all at once and couldn't trigger any filter. It didn't trigger while I was testing the feature and loading one mission after another neither. And that's considering I'm behind the mobile network NAT and Google search likes to hit me with captchas.
If I can propose something. It seems you're parsing HTML there, it may stop working when google decides to change things around. Perhaps it would be better to use google translate api - apis don't change often and are designed to do stuff like that. Downside of it would be that player would need to input api key to configuration. Also free tier is "only" 500 000 characters per month. Which should be enough - I believe
https://cloud.google.com/translate/pricing
Yeah, I understand that this method of translating is fragile, but my goal was exactly to not add any extra steps like registering for API. For example, I can't register Google Cloud because in my country only companies can do that (can't make a personal account), so I can't even test it out. And the DYOM Randomizer is already dependent on parsing HTML from DYOM website, so I figured why not do as I did.
Well, I had free time so I implemented Google Cloud Translation API anyway. Though I can't test it, if API documentation is correct it should work. I also did Yandex Cloud Translation API but it's horrible at translating these missions from my testing.
Hi,
As I mentioned earlier, I was working on a custom implementation for translation but I appreciate your work and I took some inspiration with the translation in regards to the get request urls (I previously had to deal with a more complicated backend to the translation api), tag fixups and a bunch of other things.
You are welcome to implement translation chaining or the Yandex/Google Cloud API with the current master branch if you want.
Thanks.