Skip to main content

GetLocalizedText

This function was added in DSL 5

Description

Return the localized text associated with a certain label.

function GetLocalizedText(label) --[[ ... ]] end

Parameters

  • label: string - The label to look up in the localization files. This is typically a key that corresponds to a specific text string in the localization system.

Return Values

  • text: string | ' ' - The localized text associated with the provided label. If the label does not exist, it returns a space character (' ').

Example

local text = GetLocalizedText('example_label')
if text ~= ' ' then
print('Localized text: ' .. text)
else
print('Label not found.')
end