Localization Table
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Özet
Özellikler
Yöntemler
GetTranslator(localeId: string):Instance |
RemoveEntry(key: string,source: string,context: string):() |
RemoveEntryValue(key: string,source: string,context: string,localeId: string):() |
RemoveTargetLocale(localeId: string):() |
SetContents(contents: string):() |
SetEntries(entries: Variant):() |
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):() |
Kod Örnekleri
YerelleştirmeTablosu
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", -- GetString ile kullanılacak 'expressionKey'
Values = { -- IETF dil etiketlerine karşılık gelen anahtarların ve çevirilerinin bir sözlüğü.
["ru"] = " !", -- Rusça
["fr"] = "Bonjour le monde!", -- Fransızca
["de"] = "Hallo Welt!", -- Almanca
["en-US"] = "Hello world!", -- İngilizce
["it"] = "Ciao mondo!", -- İtalyanca
["pt-BR"] = "Ol Mundo!", -- Portekizce
["ja"] = "", -- Japonca
["es"] = "Hola Mundo!", -- İspanyolca
},
},
}
local helloWorldTable = createLocalizationTable(entries)
local translatorEnglish = helloWorldTable:GetTranslator("en-US")
print(translatorEnglish:FormatByKey("Hello_World"))API Referansı
Özellikler
Development Language
Root
Yöntemler
Get Contents
Get Entries
Dönüşler
Kod Örnekleri
Bir LocalizationTable Kullanımı
local LocalizationService = game:GetService("LocalizationService")
local localizationTable = LocalizationService:FindFirstChild("LocalizationTable")
local entries = {
{
["Key"] = "0001",
["Source"] = "en-us",
["Values"] = {
["0001"] = "Merhaba Muddah, merhaba Fadduh.",
["0002"] = "İşte ben Camp Granada'dayım.",
["0003"] = "Kamp çok eğlenceli.",
["0004"] = "Ve yağmur durursa eğleneceğimizi söylüyorlar.",
},
},
}
localizationTable:SetEntries(entries)
local get_results = localizationTable:GetEntries()
for _index, dict in pairs(get_results) do
for _key, value in pairs(dict["Values"]) do -- Sözlükteki her anahtar, değer çiftini döngüye alarak dizelerimizi yazdır
print(value)
end
endGet String
Get Translator
Remove Entry
Remove Entry Value
Remove Key
Remove Target Locale
Set Contents
Set Entries
Localization Table: Set Entries(entries:Variant):()
Parametreler
entries:Variant |
Dönüşler
()
Set Entry
Set Entry Context
Set Entry Example
Set Entry Key
Set Entry Source