Pelajari
Kelas Engine
LocalizationService
Tidak Dapat Dibuat
Layanan
Tidak Direplikasi

*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.



Referensi API
Properti
RobloxLocaleId
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: Basic
LocalizationService.RobloxLocaleId:string

SystemLocaleId
Hanya Baca
Tidak Direplikasi
Baca Paralel
Kemampuan: Basic
LocalizationService.SystemLocaleId:string

Metode
GetCorescriptLocalizations
Kemampuan: Basic
LocalizationService:GetCorescriptLocalizations():Instances
Memberikan nilai
Instances

GetCountryRegionForPlayerAsync
Hasil
Kemampuan: Basic
LocalizationService:GetCountryRegionForPlayerAsync(player:Instance):string
Parameter
player:Instance
Memberikan nilai
Contoh Kode
Mendapatkan Kode Negara/Region untuk Pemain
local LocalizationService = game:GetService("LocalizationService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local result, code = pcall(LocalizationService.GetCountryRegionForPlayerAsync, LocalizationService, player)
if result and code == "CA" then
print("Halo, teman dari Kanada!")
else
print("GetCountryRegionForPlayerAsync gagal: " .. code)
end

GetTableEntries
Kemampuan: Basic
LocalizationService:GetTableEntries(instance:Instance):{any}
Parameter
instance:Instance
Nilai Default: "nil"
Memberikan nilai

GetTranslatorForLocaleAsync
Hasil
Kemampuan: Basic
LocalizationService:GetTranslatorForLocaleAsync(locale:string):Instance
Parameter
locale:string
Memberikan nilai
Contoh Kode
Mendapatkan dan Menggunakan Penerjemah untuk Lokal
local LocalizationService = game:GetService("LocalizationService")
local textLabel = script.Parent
local success, translator = pcall(function()
return LocalizationService:GetTranslatorForLocaleAsync("fr")
end)
if success then
local result = translator:Translate(textLabel, "Hello World!")
print("Halo dalam bahasa Prancis: " .. result)
else
print("GetTranslatorForLocaleAsync gagal: " .. translator)
end

GetTranslatorForPlayer
Tidak digunakan lagi

GetTranslatorForPlayerAsync
Hasil
Kemampuan: Basic
LocalizationService:GetTranslatorForPlayerAsync(player:Instance):Instance
Parameter
player:Instance
Memberikan nilai
Contoh Kode
Mendapatkan dan Menggunakan Penerjemah untuk Pemain
local LocalizationService = game:GetService("LocalizationService")
local Players = game:GetService("Players")
local textLabel = script.Parent
local success, translator = pcall(function()
return LocalizationService:GetTranslatorForPlayerAsync(Players.LocalPlayer)
end)
if success then
local result = translator:Translate(textLabel, "Halo Dunia!")
print(result)
else
print("GetTranslatorForPlayerAsync gagal: " .. translator)
end

©2026 Roblox Corporation. Roblox, logo Roblox, dan Powering Imagination termasuk dalam merek dagang kami yang terdaftar dan tidak terdaftar di AS dan negara lainnya.