LocalizationService:GetTranslatorForLocaleAsync is returning a valid Translator object even the locale doesn't exist

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):

image

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).

1 Like

Hey @rogeriodec_games thanks for the report. This is actually intended behavior. We will always try to return a Translator object if specifically asked for it in code

1 Like