Lua:translate

From Cheat Engine
Revision as of 16:38, 21 June 2026 by Leunsel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> Reference

function translate(string) : string

Returns a translation of the given string.

If no translation can be found, this function returns the original string unchanged.

Function Parameters

Parameter Type Description
string String The string to translate.

Returns

string — The translated string, or the original string if no translation could be found.

Examples

local text = translate("Health")

print(text)
local originalText = "Mana"
local translatedText = translate(originalText)

if translatedText == originalText then
  print("No translation found")
else
  print("Translation: " .. translatedText)
end

See Also

Main Pages

Related Functions