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
<> Function

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[edit]

Parameter Type Description
string String The string to translate.

Returns[edit]

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

Examples[edit]

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[edit]

Lua
Script Engine

Related Functions[edit]