Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Good day,

I just had time to test Gemini and Azure myself with this, and I can confirm it indeed does not work. The reason is that I built the JSON template completely one-dimensional like an idiot, lol. It's been a while since I did anything API related and just did not think of the fact that some API's will want a different format. I might be able to release a 0.5.0 beta version tonight to fix this if I have the time.

I tried https://rapidapi.com/gatzuma/api/deep-translate1 and got it working in both the main app and in-game tool. I'll try a few more to see if there is anything else I've missed. Do you remember which API it was that you had a problem with 'input_text'?

Here's how I set it up for the 'Deep Translate' API on RapidAPI.

Yep, you were using English to Hungarian right? Unfortunately, it seems most of those models are not better than that. It is usually due to a lack of data. Which translators have you used that translate well enough from EN-HU?

Many many thanks for your testing, you have my gratitude!

Hello,

Thanks for looking into all this; it definitely makes more sense now. I'll be looking forward to the 0.5.0 beta whenever it's ready – no need to rush! :)

The text_input issue was with TranslateAI. The error was: "Request failed: 422 Unprocessable Entity - {"detail":[{"type":"modelattributestype","loc":["body"],"msg":"Input should be a valid dictionary or object to extract fields from","input":"{"inputtext":"which APl it was that you had a problem with 'Inputtext'?","originlanguage":"en","targetlanguage":"hu"}"}]}"

Today, I tried a couple more with the underscore requirement, like OpenL Translate, but got this error: "Failed to parse JSON: Expected value at line 1 column 1 Response: Internal Server Error." The translation showed up in the program, but not when running in desktop mode. But since its quota is quite low, it doesn't bother me. It was good for testing.

Text Translator2 was similar. For some reason, it didn't recognize target_language even within the program, despite being provided. Error: "Error: Request failed: 400 Bad Request - { "status": "error", "message": "target_language parameter is required" }"

There were also APIs without the underscore requirement in the Body that showed translations in the program but failed at runtime, e.g., Lingvanex Translate. Error: "Request failed: 400 Bad Request - {"err":"Bad data.","result":""}"

I also tried this: Deep Translate, and it's interesting because it didn't work for me yesterday. However, when I re-tested it earlier today, it did work! Thanks for showing me the process, though. I did exactly the same thing yesterday, but it still didn't work then. Maybe I copied incorrect data, or there was an issue with the API itself; I'm not sure, but it's working now. I hope it stays that way! :)

Perhaps some APIs aren't working because they're unavailable, or I'm copying incorrect data, or they simply require a different format like Gemini.

Good news: I also managed to get the Cloud Translation API to work!

"It is usually due to a lack of data." - I figured you'd say that, lol.


Regarding good EN-HU translators:
Well, I haven't really used offline ones much. But I did get to try the 14-day trial for Ashampoo LocaLingo recently, and it actually gave pretty decent translations. Can't really think of or remember any other offline ones right now.

Online: DeepL, QuillBot, and various AI models offered good quality. Azure AI Translator also seemed quite good.  

During my RapidAPI tests, the good or acceptable ones were:  

  •     TranslateAI
  •     Just Translated (now unavailable, it seems)
  •     Lingvanex Translate
  •     Deep Translate

Thank you for your patience! :)

I've fixed the issue with TranslateAI, OpenL Translate, Lingvanex Translate and Gemini. I have a few more things I need to sort out, but hopefully the beta will drop tonight.
Thank you for all the debugging, it has been very helpful!

Text Translator2 seems broken. I can't even get it working with Postman. Besides it doesn't expect JSON but rather

"application/x-www-form-urlencoded"

and I am not entirely sure what it is, but even doing a POST with that format on Postman returned the same error message.

If you'd like to use Gemini or a similar LLM that is not purposed for translation, you could prompt it simply as;

```

{

    "contents": [

      {

        "parts": [

          {

            "text": "Translate this text to Swedish and only return the translated text: %text%"

          }

        ]

      }

    ]

}

```

The above format is not possible in 0.4.9 but will be in the beta release.
I tried it a little bit and it did not seem to break at all like the local LLM models I tried.

I'm curious to how you got Cloud Translation API to work. Definitely not straightforward with that one..

Thank you for the info. I would for sure be interested in adding Azure if they have an automatic limit or if it is easy for general person to set up. Problem is that they refuse to confirm my identity. Tried all my debit cards and it just won't work, so I can't even test it..

(1 edit)

Hi,

Thanks for the new update—it's super neat! :)

Gemini is now up and running perfectly for me.

I even got Text Translator2 to work! Turns out, you don't need to put the value in a JSON array. Just use this for the Body:  source_language=en&target_language=hu&text=%text%, and it worked :)

All the accessible APIs from rapidapi.com are working now. I've tested quite a few, and they've all been successful, so I'm guessing the rest should work too, assuming they're available. (A couple aren't, unfortunately.) This means we can now use not only APIs from the Translation category but also AI APIs from the Artificial Intelligence/Machine Learning category for translations.

I also tested the Azure AI Translator, and it worked without a hitch. It has an automatic limit of 2 million characters per hour, and once you hit that, it'll stop working. You can find more details here: Service limits for Azure AI Translator Service. I found it pretty straightforward to set up, and I'm just an average person :) You need to register, which requires a credit card, then go to 'Create a resource', search for 'Translator', and hit 'create'. Fill in your details like name, region, and select the F0 free tier. Hit 'create' again, and you're all set.

Here's how to configure it:

Azure AI Translator:

URL: 

https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=your_language_code

Headers:

{

    "Content-Type": "application/json",

    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY",

    "Ocp-Apim-Subscription-Region": "YOUR_REGION"

}

Body:

[

    {

        "Text": "%text%"

    }

]

Text Output Path:

.translations[0].text

Now, the Cloud Translation API is a bit different; it doesn't have an automatic limit. This could be a bit risky if you're not paying attention, because if you go over the 500,000 character/month limit, you'll automatically start paying. But don't worry, you can set up a Budget Alert. You could, for example, set a $1 limit and then get email notifications when you've used 50%, 90%, 100%, and even 150% of that amount. Setting this one up was pretty simple too. If I remember correctly, you just need to enable this: Cloud Translation API (which also requires a credit card), create an API key, and you're good to go.

And here's how to use it:

URL:

https://translation.googleapis.com/language/translate/v2?key=YOUR_API_KEY

Headers:

{

    "Content-Type": "application/json"

}

Body:

{

    "q": "%text%",

    "source": "en",

    "target": "hu"

}

Text Output Path:

data.translations[0].translatedText

Seriously, thanks again for all your hard work. This is a massive help! :)

Legend! Sorry, I've been away on holiday and got caught up with other things before that. I'll respond to this in another thread soon, I'm trying to reorganize the Itch.io forum because.. well.. it's just a terrible forum format. Locking and unsticking this thread.

The 0.5.0 beta version is now available for download. Let me know how it works for you! Many thanks :)