Engine Class
Translator
Summary
Methods
FormatByKey(key: string,args: Variant):string |
API Reference
Properties
Methods
FormatByKey
Translate
Returns
Code Samples
Translate
local Players = game:GetService("Players")
local LocalizationService = game:GetService("LocalizationService")
local success, translator = pcall(function()
return LocalizationService:GetTranslatorForPlayerAsync(Players.LocalPlayer)
end)
if success then
local trans = translator:Translate(workspace.ComputerScreen.SurfaceGui.TextLabel, "Screen")
print(trans)
else
warn("Cannot load translator for player!")
end