Lua:translate

From Cheat Engine
Revision as of 19:22, 25 June 2026 by Leunsel (talk | contribs) (Syntax Highlighting.)
(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

1 local text = translate("Health")
2 
3 print(text)
1 local originalText = "Mana"
2 local translatedText = translate(originalText)
3 
4 if translatedText == originalText then
5   print("No translation found")
6 else
7   print("Translation: " .. translatedText)
8 end

See Also

Main Pages

String and Encoding Related Lua Functions