Avg. Rating 5.0

Problem

If you reside in a locale other than the default en_US, you have to change the locale with every request that is made.

Solution

Teach the JVM to use your locale as default.

Detailed explanation

Being a german CF User, it's not always easy for me to work with localized functions.
Everytime I use functions that rely on the locale, I have to use setlocale("German (Standard)") on every request that is made.

To get rid of that, you can tell ColdFusion (or to be specific, the JVM underneath) to use a different locale.

That can be done in two ways:

- Via the CF-Administrator under Settings -> Java and JVM -> JVM args
- In the File %CFROOT%\runtime\bin\jvm.config under java.args=

Two arguments have to be entered. The language and region based on the ISO codes for those.

For me, the required args look like this:

-Duser.language=de -Duser.region=DE

 Once saved, just restart the ColdFusion Application Server and you are done.


+
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