Last active
November 7, 2019 19:18
-
-
Save spillsthrills/471eae20f66a0c2eb7dca65992f3fdbe to your computer and use it in GitHub Desktop.
Lucee getLocaleInfo script example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
//Eng | |
lang = getLocaleInfo().language; | |
writeoutput(lang); | |
writedump(getButtonText(lang)); | |
//German | |
setLocale("German (Standard)"); | |
lang = getLocaleInfo().language; | |
writeoutput(lang); | |
writedump(getButtonText(lang)); | |
public struct function getButtonText(lang) { | |
var buttonLabels = {}; | |
buttonLabels["en"] = { | |
submit:"Submit", | |
cancel:"Cancel" | |
}; | |
buttonLabels["de"] = { | |
submit:"Einreichen", | |
cancel:"Stornieren" | |
}; | |
return buttonLabels[arguments.lang]; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment