PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

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 LuaLibrary/String A lookup key for this specific entry in the LocalizationTable.
Source LuaLibrary/String The string used to format the localized string. Used as a lookup if a Key is not provided.
Context LuaLibrary/String A Instance/GetFullName path to the object that was used to generate the LocalizationTable. Used as a lookup if a Key is not provided.
Example LuaLibrary/String The string used to format the localization. Optional.
Values dictionary<LuaLibrary/String> 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

Return Type Summary

An array of dictionaries, where each dictionary represents an entry of localization data.


Code Samples


LocalizationTable:GetEntries

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.

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.