Translator cannot Translate

hi, I was working at a Translate system, but it always returns the original text, not the translated text, the code is:


function TextModule:Translate(Key,plr)
	local Translator = TextService:GetTranslatorForPlayer(plr)
	if Translator then
		local TranslatedText = Translator:FormatByKey(Key,{})
		return TranslatedText
	else
		return 'Cannot translate'
	end
end

the translation for the given key:

and the leangue I selected at settings:

i try to filter ‘Game Starts in’ to Jocul incepe in but it always returns ‘Game Starts in’

Why are you writing a translation system?

There’s no need for that. You can already enable Use Translated Content in the Configure Translations page settings.

If the issue is the game not detecting translated content, simply enable Automatic Text Capture and play your game for a while. It should automatically detect all of the content.

From there, all you have to do is get the text translated for each Language your game supports. And it should work perfectly.

1 Like

but Automatic Text Capture find the string in the Translations or he translate itself? Becouse i don’t want to make 60 Translations for Game Starts in 60, Game Starts in 59?

1 Like

Automatic Text Capture is already optimized for those situations.

It is able to detect if you have a number or a player in a sentence.

It would be more or so like this:
Game Starts in {number1}

Let’s say you had a The player Player123 is the winner! text; this would become:
The player {player1} is the winner!

I recommend you check this article: Localization | Documentation - Roblox Creator Hub

1 Like