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