---
name: LocalizationTable
last_updated: 2026-06-11T23:11:57Z
inherits:
  - Instance
  - Object
type: class
memory_category: Instances
summary: "A LocalizationTable is a database of translations. It contains source strings and translations for various languages."
---

# Class: LocalizationTable

> A LocalizationTable is a database of translations. It contains source strings
> and translations for various languages.

## Description

A LocalizationTable is a database of translations. It contains source strings
and translations for various languages. It is used with the [Translator](/docs/reference/engine/classes/Translator.md)
and [LocalizationService](/docs/reference/engine/classes/LocalizationService.md) 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:

- **Key** is an optional unique key for fast hash lookups in code. If it is
  non-empty it must be unique in the table.
- **Source** is the original text in the source language that will be used by
  the [LocalizationService](/docs/reference/engine/classes/LocalizationService.md) automatic text replacement system to match
  GUI text and render a translation instead. The Source field can be filled by
  the text capture tools, or can be set manually. For key-based lookups the
  Source value can be used as a translation for
  [LocalizationTable.SourceLocaleId](/docs/reference/engine/classes/LocalizationTable.md) if the entry doesn't have a
  translation for that locale. If Source is empty then the entry will not be
  used by the automatic replacement system.
- **Context** is the full Instance name for the object that the text appeared
  on. Context is used for disambiguation by the automatic text replacement
  system. When multiple matches for the Source are found, the system will pick
  the best match by matching backwards from the end of the Context string.
  There are other more robust ways to handle disambiguation available as well,
  like using multiple tables with [GuiBase2d.RootLocalizationTable](/docs/reference/engine/classes/GuiBase2d.md).
- **Example** is whatever you want it to be. If the text capture tool guessed
  some parameters for a string the Example field will contain an example of
  them used in context.

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](/docs/en-us/production/localization/translate-dynamic-content.md)
for more information.

## Code Samples

**LocalizationTable**

```lua
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", -- The 'expressionKey' to be used with GetString
		Values = { -- A dictionary of keys corresponding to IETF language tags, and their translations.
			["ru"] = " !", -- Russian
			["fr"] = "Bonjour le monde!", -- French
			["de"] = "Hallo Welt!", -- German
			["en-US"] = "Hello world!", -- English
			["it"] = "Ciao mondo!", -- Italian
			["pt-BR"] = "Ol Mundo!", -- Portuguese
			["ja"] = "", -- Japanese
			["es"] = "Hola Mundo!", -- Spanish
		},
	},
}

local helloWorldTable = createLocalizationTable(entries)
local translatorEnglish = helloWorldTable:GetTranslator("en-US")

print(translatorEnglish:FormatByKey("Hello_World"))
```

## Properties

### Property: LocalizationTable.SourceLocaleId

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Localization",
  "capabilities": [
    "Basic"
  ]
}
```

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".

### Property: LocalizationTable.DevelopmentLanguage *(hidden)*

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": true,
    "can_save": false
  },
  "deprecated": true,
  "thread_safety": "ReadSafe",
  "category": "Localization",
  "capabilities": [
    "Basic"
  ]
}
```

> **Deprecated:** This item has been superseded by [LocalizationTable.SourceLocaleId](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work.

The default IETF tag to use if the ''languageKey'' parameter is excluded
from the [LocalizationTable:GetString()](/docs/reference/engine/classes/LocalizationTable.md) method.

### Property: LocalizationTable.Root *(hidden)*

```json
{
  "type": "Instance",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": false
  },
  "deprecated": true,
  "thread_safety": "ReadSafe",
  "category": "Behavior",
  "capabilities": [
    "Basic"
  ]
}
```

> **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.

## Methods

### Method: LocalizationTable:GetEntries

**Signature:** `LocalizationTable:GetEntries(): Array`

The GetEntries function returns an array of dictionaries contained in a
given [LocalizationTable](/docs/reference/engine/classes/LocalizationTable.md), where each dictionary represents an entry
of localization data.

To set the entries of a LocalizationTable, you can use
[LocalizationTable:SetEntries()](/docs/reference/engine/classes/LocalizationTable.md).

Each dictionary in the array contains the following fields:

| Index | Type | Description |
| --- | --- | --- |
| **Key** | [string](/docs/reference/engine/globals/string.md) | A lookup key for this specific entry in the LocalizationTable. |
| **Source** | [string](/docs/reference/engine/globals/string.md) | The string used to format the localized string. Used as a lookup if a key is not provided. |
| **Context** | [string](/docs/reference/engine/globals/string.md) | An [Instance:GetFullName()](/docs/reference/engine/classes/Instance.md) path to the object that was used to generate the LocalizationTable. Used as a lookup if a key is not provided. |
| **Example** | [string](/docs/reference/engine/globals/string.md) | 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. |

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Returns:** `Array` — An array of dictionaries, where each dictionary represents an entry of
localization data.

**Using a LocalizationTable**

The following code sample creates a `LocalizationTable`, sets its entries,
then gets and displays its entries. In order for this example to work, a
LocalizationTable instance must be located inside the `LocalizationService`
service.

The _entries_ variable is a table of dictionaries, each with the format
required to create a LocalizationTable with
[LocalizationTable:SetEntries()](/docs/reference/engine/classes/LocalizationTable.md).

The _get_results_ variable is a table of dictionaries - the same table that we
created with the _entries_ variable. We then loop through each of the tables
in this dictionary to display its _Values_/strings.

```lua
local LocalizationService = game:GetService("LocalizationService")

local localizationTable = LocalizationService:FindFirstChild("LocalizationTable")

local entries = {
	{
		["Key"] = "0001",
		["Source"] = "en-us",
		["Values"] = {
			["0001"] = "Hello Muddah, hello Fadduh.",
			["0002"] = "Here I am at Camp Granada.",
			["0003"] = "Camp is very entertaining.",
			["0004"] = "And they say we'll have some fun if it stops raining.",
		},
	},
}

localizationTable:SetEntries(entries)
local get_results = localizationTable:GetEntries()

for _index, dict in pairs(get_results) do
	for _key, value in pairs(dict["Values"]) do -- Loop through every key, value pair in the dictionary to print our strings
		print(value)
	end
end
```

**Expected output:** ```
And they say we'll have some fun if it stops raining.
Hello Muddah, hello Fadduh.
Here I am at Camp Granada.
Camp is very entertaining.
```

### Method: LocalizationTable:GetTranslator

**Signature:** `LocalizationTable:GetTranslator(localeId: string): Instance`

Returns a [Translator](/docs/reference/engine/classes/Translator.md) for entries in this LocalizationTable, in the
specified language. The translator will first search in this table and
then look in ancestor tables.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `localeId` | `string` |  |  |

**Returns:** `Instance` — The [Translator](/docs/reference/engine/classes/Translator.md) instance for the specified locale.

### Method: LocalizationTable:RemoveEntry

**Signature:** `LocalizationTable:RemoveEntry(key: string, source: string, context: string): ()`

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

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:RemoveEntryValue

**Signature:** `LocalizationTable:RemoveEntryValue(key: string, source: string, context: string, localeId: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `localeId` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:RemoveTargetLocale

**Signature:** `LocalizationTable:RemoveTargetLocale(localeId: string): ()`

Removes all translations from the LocalizationTable with the specified
localeId.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `localeId` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntries

**Signature:** `LocalizationTable:SetEntries(entries: Variant): ()`

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()](/docs/reference/engine/classes/LocalizationTable.md)
function.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `entries` | `Variant` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntryContext

**Signature:** `LocalizationTable:SetEntryContext(key: string, source: string, context: string, newContext: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `newContext` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntryExample

**Signature:** `LocalizationTable:SetEntryExample(key: string, source: string, context: string, example: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `example` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntryKey

**Signature:** `LocalizationTable:SetEntryKey(key: string, source: string, context: string, newKey: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `newKey` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntrySource

**Signature:** `LocalizationTable:SetEntrySource(key: string, source: string, context: string, newSource: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `newSource` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntryValue

**Signature:** `LocalizationTable:SetEntryValue(key: string, source: string, context: string, localeId: string, text: string): ()`

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.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `source` | `string` |  |  |
| `context` | `string` |  |  |
| `localeId` | `string` |  |  |
| `text` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:GetContents

**Signature:** `LocalizationTable:GetContents(): string`

> **Deprecated:** This item has been superseded by [LocalizationTable:GetEntries()](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work.

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Returns:** `string`

### Method: LocalizationTable:GetString

**Signature:** `LocalizationTable:GetString(targetLocaleId: string, key: string): string`

> **Deprecated:** This item has been superseded by [LocalizationTable:GetTranslator()](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work.

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

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `targetLocaleId` | `string` |  | Specified language. |
| `key` | `string` |  | An optional unique key for fast hash lookups in code. If it is non-empty it must be unique in the table. |

**Returns:** `string` — Translated string.

### Method: LocalizationTable:RemoveKey

**Signature:** `LocalizationTable:RemoveKey(key: string): ()`

> **Deprecated:** This item has been superseded by [LocalizationTable:RemoveEntry()](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work

Deprecated in favor of [LocalizationTable:RemoveEntry()](/docs/reference/engine/classes/LocalizationTable.md). Calling
RemoveKey is the same as making the following call to RemoveEntry:

```lua
LocalizationTable:RemoveEntry(key, "", "")
```

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetContents

**Signature:** `LocalizationTable:SetContents(contents: string): ()`

> **Deprecated:** This item has been superseded by [LocalizationTable:SetEntries()](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work

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

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `contents` | `string` |  |  |

**Returns:** `()`

### Method: LocalizationTable:SetEntry

**Signature:** `LocalizationTable:SetEntry(key: string, targetLocaleId: string, text: string): ()`

> **Deprecated:** This item has been superseded by [LocalizationTable:SetEntries()](/docs/reference/engine/classes/LocalizationTable.md) which should be used in all new work

*Security: None · Thread Safety: Unsafe · Capabilities: Basic*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `string` |  |  |
| `targetLocaleId` | `string` |  |  |
| `text` | `string` |  |  |

**Returns:** `()`

## Inherited Members

### From [Instance](/docs/reference/engine/classes/Instance.md)

- **Property `Archivable`** (`boolean`): Determines if an Instance and its descendants can be cloned using
- **Property `archivable`** (`boolean`):  *(deprecated, hidden)*
- **Property `Capabilities`** (`SecurityCapabilities`): The set of capabilities allowed to be used for scripts inside this
- **Property `Name`** (`string`): A non-unique identifier of the Instance.
- **Property `Parent`** (`Instance`): Determines the hierarchical parent of the Instance.
- **Property `PredictionMode`** (`PredictionMode`): 
- **Property `RobloxLocked`** (`boolean`): A deprecated property that used to protect CoreGui objects. *(hidden)*
- **Property `Sandboxed`** (`boolean`): When enabled, the instance can only access abilities in its `Capabilities`
- **Property `UniqueId`** (`UniqueId`): A unique identifier for the instance.
- **Method `AddTag(tag: string): ()`**: Applies a tag to the instance.
- **Method `children(): Instances`**: Returns an array of the object's children. *(deprecated)*
- **Method `ClearAllChildren(): ()`**: This method destroys all of an instance's children.
- **Method `Clone(): Instance`**: Create a copy of an instance and all its descendants, ignoring instances
- **Method `clone(): Instance`**:  *(deprecated)*
- **Method `Destroy(): ()`**: Sets the Instance.Parent property to `nil`, locks the
- **Method `destroy(): ()`**:  *(deprecated)*
- **Method `FindFirstAncestor(name: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorOfClass(className: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorWhichIsA(className: string): Instance?`**: Returns the first ancestor of the Instance for whom
- **Method `FindFirstChild(name: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance found with the given name.
- **Method `findFirstChild(name: string, recursive?: boolean): Instance`**:  *(deprecated)*
- **Method `FindFirstChildOfClass(className: string): Instance?`**: Returns the first child of the Instance whose
- **Method `FindFirstChildWhichIsA(className: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance for whom
- **Method `FindFirstDescendant(name: string): Instance?`**: Returns the first descendant found with the given Instance.Name.
- **Method `GetActor(): Actor?`**: Returns the Actor associated with the Instance, if any.
- **Method `GetAttribute(attribute: string): Variant`**: Returns the value which has been assigned to the given attribute name.
- **Method `GetAttributeChangedSignal(attribute: string): RBXScriptSignal`**: Returns an event that fires when the given attribute changes.
- **Method `GetAttributes(): Dictionary`**: Returns a dictionary of the instance's attributes.
- **Method `GetChildren(): Instances`**: Returns an array containing all of the instance's children.
- **Method `getChildren(): Instances`**:  *(deprecated)*
- **Method `GetDebugId(scopeLength?: int): string`**: Returns a coded string of the debug ID used internally by Roblox.
- **Method `GetDescendants(): Instances`**: Returns an array containing all of the descendants of the instance.
- **Method `GetFullName(): string`**: Returns a string describing the instance's ancestry.
- **Method `GetStyled(name: string, selector: string?): Variant`**: Returns the styled or explicitly modified value of the specified property,
- **Method `GetStyledPropertyChangedSignal(property: string): RBXScriptSignal`**: 
- **Method `GetTags(): Array`**: Gets an array of all tags applied to the instance.
- **Method `HasTag(tag: string): boolean`**: Check whether the instance has a given tag.
- **Method `IsAncestorOf(descendant: Instance): boolean`**: Returns true if an Instance is an ancestor of the given
- **Method `IsDescendantOf(ancestor: Instance): boolean`**: Returns `true` if an Instance is a descendant of the given
- **Method `isDescendantOf(ancestor: Instance): boolean`**:  *(deprecated)*
- **Method `IsPropertyModified(property: string): boolean`**: Returns `true` if the value stored in the specified property is not equal
- **Method `QueryDescendants(selector: string): Instances`**: Returns an array containing all descendants of the instance that match the
- **Method `Remove(): ()`**: Sets the object's `Parent` to `nil`, and does the same for all its *(deprecated)*
- **Method `remove(): ()`**:  *(deprecated)*
- **Method `RemoveTag(tag: string): ()`**: Removes a tag from the instance.
- **Method `ResetPropertyToDefault(property: string): ()`**: Resets a property to its default value.
- **Method `SetAttribute(attribute: string, value: Variant): ()`**: Sets the attribute with the given name to the given value.
- **Method `WaitForChild(childName: string, timeOut: double): Instance`**: Returns the child of the Instance with the given name. If the
- **Event `AncestryChanged`**: Fires when the Instance.Parent property of this object or one of
- **Event `AttributeChanged`**: Fires whenever an attribute is changed on the Instance.
- **Event `ChildAdded`**: Fires after an object is parented to this Instance.
- **Event `childAdded`**:  *(deprecated)*
- **Event `ChildRemoved`**: Fires after a child is removed from this Instance.
- **Event `DescendantAdded`**: Fires after a descendant is added to the Instance.
- **Event `DescendantRemoving`**: Fires immediately before a descendant of the Instance is removed.
- **Event `Destroying`**: Fires immediately before (or is deferred until after) the instance is
- **Event `StyledPropertiesChanged`**: Fires whenever any style property is changed on the instance, including

### From [Object](/docs/reference/engine/classes/Object.md)

- **Property `ClassName`** (`string`): A read-only string representing the class this Object belongs to.
- **Property `className`** (`string`):  *(deprecated)*
- **Method `GetPropertyChangedSignal(property: string): RBXScriptSignal`**: Get an event that fires when a given property of the object changes.
- **Method `IsA(className: string): boolean`**: Returns true if an object's class matches or inherits from a given class.
- **Method `isA(className: string): boolean`**:  *(deprecated)*
- **Event `Changed`**: Fires immediately after a property of the object changes, with some