Not yet rated

Problem

While working with ColdFusion we are using Java based locale system. In some cases we may need to display the active locale on the system.

Solution

To be able to display the locale on code execution, we can use embedded getLocale() function.

Detailed explanation

Here is a sample code:

<!--- Displaying Current Locale ---> <cfoutput>#getLocale()#</cfoutput> <br />
<br />

<!--- Setting and displaying a specific locale --->
<cfscript>
    /*
        Setting required locale
        tr_TR used for Turkish
    */
    SetLocale("tr_TR");
</cfscript>   
<cfoutput>#getLocale()#</cfoutput>


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes