21 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

LocalizationTable

Inherits from: Instance → Object

A LocalizationTable is a database of translations. It contains source strings and translations for various languages. It is used with the Translator and LocalizationService auto-translator system to control text translations in the game. LocalizationTables are designed to be treated as resources, like a texture or a script. They are not optimized to be modified at runtime. Changing the contents of a table will cause the entire contents of the table to be replicated to all players.

LocalizationTable Entries

Each LocalizationTable contains a set of entries. Each entry contains the translations of the text, along with some special fields:

All of these fields are optional, but at least either Key or Source must be non-empty. No two entries can have the same Key, Source, and Context.

See Translating Dynamic Content for more information.

Inherits from: Instance

Memory category: Instances

Code samples: View on Creator Hub (LocalizationTable1).

Properties

NameType / ReturnsDescription
LocalizationTable.DevelopmentLanguagestringThe default IETF tag to use if the ''languageKey'' parameter is excluded from the LocalizationTable:GetString() method.
LocalizationTable.RootInstanceThe object that is being targeted for localization by this table. Localization is applied to it and all of it's descendants.
LocalizationTable.SourceLocaleIdstringThe locale of source strings.

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

LocalizationTable.DevelopmentLanguage

Deprecated. This item has been superseded by LocalizationTable.SourceLocaleId which should be used in all new work.

The default IETF tag to use if the ''languageKey'' parameter is excluded from the LocalizationTable:GetString() method.

FieldValue
typestring
tags["Hidden","NotReplicated","Deprecated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryLocalization
serialization{"can_load":true,"can_save":false}
capabilities["Basic"]

LocalizationTable.Root

Deprecated. This item is deprecated. Do not use it for new work.

The object that is being targeted for localization by this table. Localization is applied to it and all of it's descendants.

FieldValue
typeInstance
tags["Hidden","NotReplicated","Deprecated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryBehavior
serialization{"can_load":false,"can_save":false}
capabilities["Basic"]

LocalizationTable.SourceLocaleId

The Roblox locale of the input key strings for this table, for example "en-us" or "es-es." This is typically the "development language" of the game. For a Translator that merges multiple LocalizationTable objects, it's the LocaleId of the Default LocalizationTable. Defaults to "en-us".

FieldValue
typestring
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryLocalization
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Methods

NameType / ReturnsDescription
LocalizationTable:GetContentsstringReturns the contents of the LocalizationTable serialized as a JSON string.
LocalizationTable:GetEntriesArrayReturns an array of dictionaries, where each dictionary represents an entry of localization data.
LocalizationTable:GetStringstringReturns a translation based on the specified language and key.
LocalizationTable:GetTranslatorInstanceReturns a Translator for entries in this LocalizationTable, in the specified locale.
LocalizationTable:RemoveEntry()Removes an entry from the LocalizationTable, using the specified key, source, and context to narrow down the specific entry to be removed.
LocalizationTable:RemoveEntryValue()Removes a single language translation from the LocalizationTable, using the provided key, source, context, and localeId to narrow down the specific entry to be removed.
LocalizationTable:RemoveKey()Deprecated in favor of LocalizationTable:RemoveEntry().
LocalizationTable:RemoveTargetLocale()Removes all translations from the LocalizationTable with the specified localeId.
LocalizationTable:SetContents()Sets the contents of the LocalizationTable, via the legacy JSON format.
LocalizationTable:SetEntries()Sets the contents of the LocalizationTable.
LocalizationTable:SetEntry()Sets the translation text for the targetLocaleId locale on the entry identified by key, creating the entry if it doesn't exist.
LocalizationTable:SetEntryContext()Sets the Context field of a LocalizationTable entry to newContext, using the specified key, source, and context to narrow down the entry that will have this change applied.
LocalizationTable:SetEntryExample()Sets the Example field of a LocalizationTable entry to example, using the specified key, source, and context to narrow down the entry that will have this change applied.
LocalizationTable:SetEntryKey()Sets the Key field of a LocalizationTable entry to newKey, using the specified key, source, and context to narrow down the entry that will have this change applied.
LocalizationTable:SetEntrySource()Sets the Source field of a LocalizationTable entry to newSource, using the specified key, source, and context to narrow down the entry that will have this change applied.
LocalizationTable:SetEntryValue()Sets the text of the specified localeId in a LocalizationTable entry, using the specified key, source, and context to narrow down the entry that will have this change applied.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

LocalizationTable:GetContents

Deprecated. This item has been superseded by LocalizationTable:GetEntries() which should be used in all new work.

Deprecated. Prefer LocalizationTable:GetEntries(), which returns the same data as a structured array of dictionaries. Returns all entries in the LocalizationTable encoded as a JSON-formatted string, the legacy serialized representation of the table's contents. Each entry is an object containing its key, context, examples, and source fields (each omitted when empty) along with a values map of locale IDs to translated strings.

Returns

TypeDescription
stringThe table's entries encoded as a JSON-formatted string.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:GetEntries

The GetEntries function returns an array of dictionaries contained in a given LocalizationTable, where each dictionary represents an entry of localization data.

To set the entries of a LocalizationTable, you can use LocalizationTable:SetEntries().

Each dictionary in the array contains the following fields:

Index Type Description
Key Library.string A lookup key for this specific entry in the LocalizationTable.
Source Library.string The string used to format the localized string. Used as a lookup if a key is not provided.
Context Library.string An Class.Instance:GetFullName() path to the object that was used to generate the LocalizationTable. Used as a lookup if a key is not provided.
Example Library.string The string used to format the localization. Optional.
Values Dictionary A dictionary of language translations for this localization entry. The keys of this dictionary are locale ids, and the values are strings that are used to apply localization for the language corresponding to the locale id.

Returns

TypeDescription
ArrayAn array of dictionaries, where each dictionary represents an entry of localization data.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

Code samples: View on Creator Hub (LocalizationTable-GetEntries).

LocalizationTable:GetString

Deprecated. This item has been superseded by LocalizationTable:GetTranslator() which should be used in all new work.

The GetString function returns a translation based on the specified language and key.

Parameters

NameTypeDefaultDescription
targetLocaleIdstringSpecified language.
keystringAn optional unique key for fast hash lookups in code. If it is non-empty it must be unique in the table.

Returns

TypeDescription
stringTranslated string.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:GetTranslator

Returns a Translator for entries in this LocalizationTable, in the specified language. The translator will first search in this table and then look in ancestor tables.

Parameters

NameTypeDefaultDescription
localeIdstringA Roblox locale identifier (for example, "en-us" or "es-es") specifying the language the returned Translator should target.

Returns

TypeDescription
InstanceThe Translator instance for the specified locale.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:RemoveEntry

Removes an entry from the LocalizationTable, using the specified key, source, and context to narrow down the specific entry to be removed.

The entry is identified by the (key, source, context) triple. If key is non-empty it alone identifies the entry because keys are unique within the table. If key is empty the entry is matched by the (source, context) pair. When no matching entry exists the call is a silent no-op.

Removing an entry deletes all of its translations and metadata. To remove only a single locale's translation from an entry while keeping the entry itself, use LocalizationTable:RemoveEntryValue() instead.

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry to remove. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path used for disambiguation. Used with source to identify the entry when key is empty.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:RemoveEntryValue

Removes a single language translation from the LocalizationTable, using the provided key, source, context, and localeId to narrow down the specific entry to be modified.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). Once the entry is found, only the translation for localeId is erased; the entry itself and all other locale translations remain intact. The localeId is case-insensitive (it is canonicalized internally). If no matching entry exists, or the entry has no translation for localeId, the call is a silent no-op.

To remove the entire entry including all translations, use LocalizationTable:RemoveEntry(). To remove every translation of a given locale across all entries, use LocalizationTable:RemoveTargetLocale().

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path used for disambiguation. Used with source to identify the entry when key is empty.
localeIdstringThe locale identifier (for example, "fr-fr") whose translation should be removed from the entry.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:RemoveKey

Deprecated. This item has been superseded by LocalizationTable:RemoveEntry() which should be used in all new work

Deprecated in favor of LocalizationTable:RemoveEntry(). Calling RemoveKey is the same as making the following call to RemoveEntry:

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry to remove.

Returns

TypeDescription
()
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Basic"]

Code samples: View on Creator Hub (LocalizationTable-RemoveKey).

LocalizationTable:RemoveTargetLocale

Removes all translations from the LocalizationTable with the specified localeId.

This is a bulk operation that iterates every entry in the table and erases the translation for localeId from each one. Entries themselves are not removed even if they have no remaining translations after this call. To remove a single translation from one specific entry, use LocalizationTable:RemoveEntryValue() instead.

Parameters

NameTypeDefaultDescription
localeIdstringA Roblox locale identifier (for example, "fr-fr") specifying which language's translations to remove from all entries.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetContents

Deprecated. This item has been superseded by LocalizationTable:SetEntries() which should be used in all new work

The SetContents function sets the contents of the LocalizationTable, via the legacy JSON format.

Parameters

NameTypeDefaultDescription
contentsstringA JSON-formatted string encoding the table's entries, in the same format returned by LocalizationTable:GetContents().

Returns

TypeDescription
()
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntries

Sets the contents of the LocalizationTable.

The entries parameter should be an array of dictionaries in the same format as the one returned from the LocalizationTable:GetEntries() function.

Parameters

NameTypeDefaultDescription
entriesVariantAn array of dictionaries in the same format returned by LocalizationTable:GetEntries(), each containing Key, Source, Context, Example, and Values fields.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntry

Deprecated. This item has been superseded by LocalizationTable:SetEntries() which should be used in all new work.

Deprecated. Prefer LocalizationTable:SetEntryValue() for matching an entry by key, source, and context, or LocalizationTable:SetEntries() to set many entries at once. Sets the translation text for the locale targetLocaleId on the LocalizationTable entry identified by key, creating a new entry with an empty source and context if no entry with that key exists. When targetLocaleId matches the table's LocalizationTable.SourceLocaleId, the entry's Source field is also set to text.

Parameters

NameTypeDefaultDescription
keystringThe unique key identifying the entry. If no entry with this key exists, a new entry is created.
targetLocaleIdstringThe Roblox locale identifier (for example, "en-us" or "fr-fr") for the translation to set.
textstringThe translation text to store for the specified locale.

Returns

TypeDescription
()
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntryContext

Sets the Context field of a LocalizationTable entry to newContext, using the specified key, source, and context to narrow down the entry that will have this change applied.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). If no matching entry exists, a new entry is created with the provided key, source, and newContext. The method throws an error if setting the new context would cause the entry to conflict with another existing entry that shares the same key, source, and context combination.

The Context field stores an Instance:GetFullName() path that the automatic text replacement system uses for disambiguation when multiple entries share the same Source string.

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe current Instance:GetFullName() path of the entry. Used with source to identify the entry when key is empty.
newContextstringThe new context string to assign to the entry.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntryExample

Sets the Example field of a LocalizationTable entry to example, using the specified key, source, and context to narrow down the entry that will have this change applied.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). If no matching entry exists, a new entry is created with the provided key, source, and context. The new example value always overwrites any existing example text on the entry.

The Example field is an arbitrary metadata string. The text-capture tools use it to store a sample of parameterized content in context, but developers may store any helpful annotation.

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path of the entry. Used with source to identify the entry when key is empty.
examplestringThe new example text to assign to the entry, typically a sample of parameterized content in context.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntryKey

Sets the Key field of a LocalizationTable entry to newKey, using the specified key, source, and context to narrow down the entry that will have this change applied.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). If no matching entry exists, a new entry is created with newKey, the provided source, and context. The method throws an error if newKey would conflict with an existing entry's key, because keys must be unique within the table. If newKey equals the entry's current key the call is a no-op.

The Key field is an optional unique identifier for fast hash lookups via Translator:FormatByKey(). When non-empty it must be unique across the entire table.

Parameters

NameTypeDefaultDescription
keystringThe current unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path of the entry. Used with source to identify the entry when key is empty.
newKeystringThe new key string to assign to the entry. Must be unique within the table if non-empty.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntrySource

Sets the Source field of a LocalizationTable entry to newSource, using the specified key, source, and context to narrow down the entry that will have this change applied.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). If no matching entry exists, a new entry is created with the provided key, newSource, and context. The method throws an error if the resulting (key, newSource, context) combination would conflict with an existing entry. If newSource equals the entry's current source the call is a no-op.

The Source field is the original text in the source language used by the LocalizationService automatic text replacement system to match GUI text at runtime. Changing the source also recomputes the internal expression matcher, so parameterized format strings (e.g. {1:translate}) are re-parsed immediately.

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe current source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path of the entry. Used with source to identify the entry when key is empty.
newSourcestringThe new source text to assign to the entry. Used by the automatic text replacement system for matching GUI text at runtime.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

LocalizationTable:SetEntryValue

Sets the text of the specified localeId in a LocalizationTable entry, using the specified key, source, and context to narrow down the entry that will have this change applied.

The entry is identified by the (key, source, context) triple (see LocalizationTable:RemoveEntry() for lookup rules). If no matching entry exists, a new entry is created with the provided key, source, and context — this throws an error if both key and source are empty. The localeId is case-insensitive (it is canonicalized internally).

If text is non-empty the translation is stored (or replaced) for localeId on that entry. The text must be a valid format string (parameters like {1:translate} must be well-formed or the call throws). If text is an empty string the translation for localeId is removed from the entry, equivalent to calling LocalizationTable:RemoveEntryValue().

To set multiple entries at once, use LocalizationTable:SetEntries().

Parameters

NameTypeDefaultDescription
keystringThe unique key of the entry. If non-empty, identifies the entry by itself.
sourcestringThe source text of the entry. Used with context to identify the entry when key is empty.
contextstringThe Instance:GetFullName() path of the entry. Used with source to identify the entry when key is empty.
localeIdstringThe Roblox locale identifier (for example, "fr-fr") for the translation to set or remove.
textstringThe translation text to store. If empty, the translation for the specified locale is removed from the entry.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.