You can write your topic however you want, but you need to answer these questions:
Im trying to translate a text but it doesn’t translate.
I looked in the developer hub but, I got confused.
Do I need to enable something to make it print “Hello World” in french?
local res,trans = pcall(function()
return LS:GetTranslatorForLocaleAsync("fr")
end)
if res then
local ctx = game.Workspace.Sign.SurfaceGui.Frame.TextLabel
local res = trans:Translate(ctx, "Hello World!")
print('Hello in French: ' .. res)
else
print('GetTranslatorForLocaleAsync failed: ' .. trans)
end
(I haven’t used localization myself, so I may be wrong. This answer is based on quick research.)
From what I can tell, Translator:Translate() gets a translation from a LocalizationTable, which can be set up through the localization portal on the website. Translations don’t appear to be automatic, but instead require a human to manually translate it through the portal. The reason the translation is returning the same string is because it has not been translated yet. Thankfully, all strings don’t have to be manually added to the portal:
If you call Translate() with a source text string that does not exist in the localization portal, that string will be automatically added to the portal (and the downloadable .csv spreadsheet) so that human translators can locate it and provide translations.
Source strings should also be discoverable by Automatic Text Capture if enabled.
TL;DR: Translations must be done by humans, but source strings are automatically added to the localization portal once called through Translate().