Skip to content

Instantly share code, notes, and snippets.

@spillsthrills
Last active November 7, 2019 19:18
Show Gist options
  • Save spillsthrills/471eae20f66a0c2eb7dca65992f3fdbe to your computer and use it in GitHub Desktop.
Save spillsthrills/471eae20f66a0c2eb7dca65992f3fdbe to your computer and use it in GitHub Desktop.
Lucee getLocaleInfo script example
<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