学ぶ
エンジンクラス
LocalizationService
作成できません
サービス
複製されていません

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。



APIリファレンス
プロパティ
RobloxLocaleId
読み取り専用
複製されていません
並列読み取り
機能: Basic
LocalizationService.RobloxLocaleId:string

SystemLocaleId
読み取り専用
複製されていません
並列読み取り
機能: Basic
LocalizationService.SystemLocaleId:string

方法
GetCorescriptLocalizations
機能: Basic
LocalizationService:GetCorescriptLocalizations():Instances
戻り値
Instances

GetCountryRegionForPlayerAsync
イールド
機能: Basic
LocalizationService:GetCountryRegionForPlayerAsync(player:Instance):string
パラメータ
player:Instance
戻り値
コードサンプル
プレイヤーの国/地域コードを取得する
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("カナダの友達、こんにちは!")
else
print("GetCountryRegionForPlayerAsyncが失敗しました: " .. code)
end

GetTableEntries
機能: Basic
LocalizationService:GetTableEntries(instance:Instance):{any}
パラメータ
instance:Instance
既定値: "nil"
戻り値

GetTranslatorForLocaleAsync
イールド
機能: Basic
LocalizationService:GetTranslatorForLocaleAsync(locale:string):Instance
パラメータ
locale:string
戻り値
コードサンプル
ロケールのための翻訳者を取得して使用する
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("フランス語のこんにちは: " .. result)
else
print("GetTranslatorForLocaleAsync failed: " .. translator)
end

GetTranslatorForPlayer
非推奨

GetTranslatorForPlayerAsync
イールド
機能: Basic
LocalizationService:GetTranslatorForPlayerAsync(player:Instance):Instance
パラメータ
player:Instance
戻り値
コードサンプル
プレイヤーのための翻訳者を取得して使用する
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, "Hello World!")
print(result)
else
print("GetTranslatorForPlayerAsync failed: " .. translator)
end

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。