学ぶ
エンジンクラス
LocalizationTable

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


概要
プロパティ
Root:Instance
非推奨
方法
GetContents():string
非推奨
GetString(targetLocaleId: string,key: string):string
非推奨
RemoveEntry(key: string,source: string,context: string):()
RemoveEntryValue(key: string,source: string,context: string,localeId: string):()
RemoveKey(key: string):()
非推奨
SetContents(contents: string):()
非推奨
SetEntries(entries: Variant):()
SetEntry(key: string,targetLocaleId: string,text: string):()
非推奨
SetEntryContext(key: string,source: string,context: string,newContext: string):()
SetEntryExample(key: string,source: string,context: string,example: string):()
SetEntryKey(key: string,source: string,context: string,newKey: string):()
SetEntrySource(key: string,source: string,context: string,newSource: string):()
SetEntryValue(key: string,source: string,context: string,localeId: string,text: string):()
継承されたメンバー
コードサンプル
ローカリゼーションテーブル
local LocalizationService = game:GetService("LocalizationService")
local function createLocalizationTable(entries): LocalizationTable
local localTable = Instance.new("LocalizationTable")
localTable.SourceLocaleId = LocalizationService.SystemLocaleId
localTable:SetEntries(entries)
return localTable
end
local entries = {
{
Key = "Hello_World", -- 'expressionKey' を GetString と共に使用します
Values = { -- IETF 言語タグに対応するキーと、その翻訳の辞書。
["ru"] = " !", -- ロシア語
["fr"] = "Bonjour le monde!", -- フランス語
["de"] = "Hallo Welt!", -- ドイツ語
["en-US"] = "Hello world!", -- 英語
["it"] = "Ciao mondo!", -- イタリア語
["pt-BR"] = "Ol Mundo!", -- ポルトガル語
["ja"] = "こんにちは世界!", -- 日本語
["es"] = "Hola Mundo!", -- スペイン語
},
},
}
local helloWorldTable = createLocalizationTable(entries)
local translatorEnglish = helloWorldTable:GetTranslator("en-US")
print(translatorEnglish:FormatByKey("Hello_World"))

APIリファレンス
プロパティ
DevelopmentLanguage
非推奨

Root
非推奨

SourceLocaleId
並列読み取り
機能: Basic
LocalizationTable.SourceLocaleId:string

方法
GetContents
非推奨

GetEntries
機能: Basic
LocalizationTable:GetEntries():{any}
戻り値
コードサンプル
ローカリゼーションテーブルの使用
local LocalizationService = game:GetService("LocalizationService")
local localizationTable = LocalizationService:FindFirstChild("LocalizationTable")
local entries = {
{
["Key"] = "0001",
["Source"] = "en-us",
["Values"] = {
["0001"] = "こんにちは、ママ、こんにちは、パパ。",
["0002"] = "私はキャンプグラナダにいます。",
["0003"] = "キャンプはとても楽しいです。",
["0004"] = "そして、雨が止めば楽しいこともあると言います。",
},
},
}
localizationTable:SetEntries(entries)
local get_results = localizationTable:GetEntries()
for _index, dict in pairs(get_results) do
for _key, value in pairs(dict["Values"]) do -- 辞書内のすべてのキー、値のペアをループして文字列を印刷
print(value)
end
end

GetString
非推奨

GetTranslator
機能: Basic
LocalizationTable:GetTranslator(localeId:string):Instance
パラメータ
localeId:string
戻り値

RemoveEntry
機能: Basic
LocalizationTable:RemoveEntry(
key:string, source:string, context:string
):()
パラメータ
key:string
source:string
context:string
戻り値
()

RemoveEntryValue
機能: Basic
LocalizationTable:RemoveEntryValue(
key:string, source:string, context:string, localeId:string
):()
パラメータ
key:string
source:string
context:string
localeId:string
戻り値
()

RemoveKey
非推奨

RemoveTargetLocale
機能: Basic
LocalizationTable:RemoveTargetLocale(localeId:string):()
パラメータ
localeId:string
戻り値
()

SetContents
非推奨

SetEntries
機能: Basic
LocalizationTable:SetEntries(entries:Variant):()
パラメータ
entries:Variant
戻り値
()

SetEntry
非推奨

SetEntryContext
機能: Basic
LocalizationTable:SetEntryContext(
key:string, source:string, context:string, newContext:string
):()
パラメータ
key:string
source:string
context:string
newContext:string
戻り値
()

SetEntryExample
機能: Basic
LocalizationTable:SetEntryExample(
key:string, source:string, context:string, example:string
):()
パラメータ
key:string
source:string
context:string
example:string
戻り値
()

SetEntryKey
機能: Basic
LocalizationTable:SetEntryKey(
key:string, source:string, context:string, newKey:string
):()
パラメータ
key:string
source:string
context:string
newKey:string
戻り値
()

SetEntrySource
機能: Basic
LocalizationTable:SetEntrySource(
key:string, source:string, context:string, newSource:string
):()
パラメータ
key:string
source:string
context:string
newSource:string
戻り値
()

SetEntryValue
機能: Basic
LocalizationTable:SetEntryValue(
key:string, source:string, context:string, localeId:string, text:string
):()
パラメータ
key:string
source:string
context:string
localeId:string
text:string
戻り値
()

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