Everything works but how do i translate chats within the global chat channel?
(I do know that chat in the main local channel is automatically translated, but not in my global channel)
I’m mainly trying to figure out if a roblox method/API exists which I can run these messages through to translate.
--[[ Local Script NOT TESTED]]-
local text = "Hello"
local locale = "fr" -- fr for french
local Players = game:GetService("Players")
local LocalizationSerivce = game:GetService("LocalizationService")
local localPlayer = Players.LocalPlayer
local success, translator = pcall(function()
return LocalizationService:GetTranslatorForLocaleAsync(locale)
end)
if success then
local translatedText = translator:Translate(game, text)
print(translatedText)
end
Cool, thanks, but this only works for strings which are stored in your localization tables? So translating random chat messages isn’t working. It’ll only work if i input a string which I’ve already had auto translated - e.g. text from a textlabel in game.
I wonder if there’s a way to translate random chat messages, similar to the way roblox does it in the main chat window. I appreciate your response though, super helpful.