SA.Rainbomizer icon indicating copy to clipboard operation
SA.Rainbomizer copied to clipboard

DYOM Missions Translation

Open met-nikita opened this issue 2 years ago • 5 comments

This feature automatically translates (or, at least, attempts to) mission loaded by DYOM Randomizer from any language supported by Google Translate to English. unknown_2022 07 15-16 34_4

met-nikita avatar Jul 15 '22 15:07 met-nikita

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.

Parik27 avatar Jul 16 '22 11:07 Parik27

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.

met-nikita avatar Jul 16 '22 12:07 met-nikita

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

mateusz-lisik avatar Aug 13 '22 17:08 mateusz-lisik

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.

met-nikita avatar Aug 13 '22 21:08 met-nikita

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.

met-nikita avatar Aug 14 '22 15:08 met-nikita

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.

Parik27 avatar Aug 24 '22 00:08 Parik27