Back in 2016, I made a module by the name of “TranslationService” that allows you to translate text to different languages with the Yandex.Translate API. While the source behind it is extremely simple and small, it’s free to use for anyone that wants to try it and is just here for the sake of simplicity. With Roblox starting to roll out with multi-lingual support, games are also starting to support multiple languages too. While I would highly recommend you find a native speaker for most cases due to a lack of accuracy in machine translation, this module might be necessary in some cases such as translating chat messages.
TranslationService.Translate(
string OriginalPhrase,
string LanguageToTranslateTo,
string LanguageToTranslateFrom, (optional, default = "en")
string Key, (optional, default = nil)
string Service (optional, default = "Yandex", accepts "Yandex", "Google" or "Microsoft")
) -- Returns the translated phrase
TranslationService.Languages.Google -- Returns a table of available languages with Google Translate
TranslationService.Languages.Yandex -- Returns a table of available languages with Yandex.Translate
TranslationService.Languages.Microsoft -- Returns a table of available languages with Microsoft Translator
The module accepts two letter abbreviations of a language or its full name. If I remember correctly, the Yandex.Translate public key used for the module has a limit of 10 million words to be translated per month. Although unlikely to reach this limit, you may find it necessary to get your own key from Yandex.Translate, Microsoft Translator or Google Translate, which you can then pass as the Key argument.
Examples:
local TranslationService = require(733018661)
print(TranslationService.Translate("Hello, world!", "fr"))
> Bonjour tout le monde!
print(TranslationService.Translate("This is an example.", "Spanish", "English", nil, "Google"))
I’ll look into the Google Translate API when I get home, but as @WhereAreTheLights has mentioned, it does not have a free plan, so using your own API key would probably have to be mandatory if you choose to use it instead of the default free Yandex.Translate option.
The module now supports Google Translate and has a temporary public key already available for testing, I have updated the original post in favour of the changes.
This is great! Thanks for implementing that. I don’t even have an API key, but I’ve wanted to use Google Translate from Roblox before. I’m sure people will use it.
Pretty cool that you’re sharing this but I’m fairly 100% sure that devs can just enable auto localisation & auto machine translation on their game (and I’m pretty sure roblox use google translate api)
But I suppose it does still have a place for translating into English, translating into a much larger amount of languages, and supporting alternatives to Google Translate.
Either way, it’s just a basic API wrapper I posted here three years ago that is free-for-use if anyone finds a use for it.
I doubt it. This resource was posted 3 years ago, and Roblox has since included built in translation. Not sure why this is being bumped after all these years.