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

FormatByKey

Returns the localized text string in a LocalizationTable based on its Translator locale, by key. The optional args table is used for filling format parameters in the matching text entry.

Note that this method will throw an error in the following cases:

  • If none of the LocalizationTable|LocalizationTables available to this Translator include a value for the given key.
  • If the articles/localization format strings|format string for the key uses numbered parameters and args is not an array.
  • If the articles/localization format strings|format string uses named parameters and args is not a table of key-value pairs.
  • If args is missing values for parameters that are used in the matching articles/localization format strings|format string.

See articles/utilizing localization apis|Utilizing Localization APIs for more details and usage examples of this function.

Parameters

Name Type Default Description

key

The Key value to look up and translate.

If the Source text and translations contain articles/localization format strings|format strings, a Lua table of values or key-value pairs, depending on whether the format strings are numbered or named.

Returns

Return Type Summary