local LocalizationService = game:GetService("LocalizationService")
local success, translator = pcall(function()
return LocalizationService:GetTranslatorForLocaleAsync("fr")
end)
if success then
local result = translator:Translate(game, "Hello World!")
print("Hello in French: " .. result)
else
print("GetTranslatorForLocaleAsync failed: " .. translator)
end
Set a breakpoint on line 8 (local result =
and watch translator
variable):
Expected behavior
If the language was not configured in the experience, GetTranslatorForLocaleAsync
should not return a valid object in this language (as shown in the image above).