Apprendre
Classe de moteur
Translator
Création impossible
Non répliqué

*Ce contenu est traduit en utilisant l'IA (Beta) et peut contenir des erreurs. Pour consulter cette page en anglais, clique ici.


Résumé
Propriétés
Méthodes
FormatByKey(key: string,args: Variant):string
Membres hérités

Référence API
Propriétés
LocaleId
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : Basic
Translator.LocaleId:string

Méthodes
FormatByKey
Capacités : Basic
Translator:FormatByKey(
key:string, args:Variant
Paramètres
key:string
args:Variant
Retours

Translate
Capacités : Basic
Translator:Translate(
context:Instance, text:string
Paramètres
context:Instance
text:string
Retours
Échantillons de code
Traduire
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, "Écran")
print(trans)
else
warn("Impossible de charger le traducteur pour le joueur !")
end

©2026 Société Roblox. Roblox, le logo Roblox et Powering Imagination font partie de nos marques déposées aux États-Unis et dans d'autres pays.