Problem with SetLocale() GetLocale()

Description

I made a test to set Locale to Italian (Standard) but I see days of a week in english format
I try to see the Lucee Documentation and try to execute my code with the Example - Run Code panel

<cfscript>
writeOutput(getlocale());
writeOutput(' To ');
setLocale('italian (standard)');
writeOutput(getlocale());
writeOutput('--->' & dateformat(now(), 'ddd'));
</cfscript>

Results
english (us) To italian (standard)--->Wed

The results are in the screenshots also

Environment

Lucee Documentation - Example - Run Code panel
url: https://docs.lucee.org/reference/functions/getlocale.html

Attachments

1
  • 03 Mar 2021, 06:27 pm

Activity

David R. 4 March 2021 at 07:54

Yes. Is true. I used in the past.

Thanks a lot for your suggestions.

D

Zac Spitzer 4 March 2021 at 07:31

you need to use the functions with a LS (local-specific) prefix,

the unprefixed functions are always in English, so you can use them with code/system etc which always require English

https://trycf.com/gist/417f76753666f2b4a25e9b184f21539c/lucee5?theme=monokai

https://docs.lucee.org/categories/internationalization.html

I just cross referenced the docs and updated that example

https://github.com/lucee/lucee-docs/pull/1070

https://github.com/lucee/lucee-docs/commit/c3e8b949646e1e68733f9de85eb6b48fdc182077

 

David R. 3 March 2021 at 21:01

You can past below code to the panel:

https://docs.lucee.org/reference/functions/getlocale.html

 

<cfscript>
setLocale('italian (standard)');
writeOutput(getlocale());
Writeoutput( '<br>'&
Isdate (now())
);
writeOutput('-----' & dateformat(now(), 'ddd'));
Writeoutput( '<br>'& Decimalformat(50005.99)
);

</cfscript>

 

When I Run, the result is:

italian (standard)
true-----Wed
50,005.99

So, decimalformat and dateformat don't read the Locale setting.

Is it correctl? Because without it, I have to manage some functions to have italian output format.

I need the below result:

italian (standard)
true-----Mer
50.005,99

I can do it with mask or other functions but before doing it I'll wait your suggestions. Thanks

Zac Spitzer 3 March 2021 at 18:46
Edited

shouldn’t that be lsDateFormat? dateFormat doesn't take local into consideration?

Cannot Reproduce

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 3 March 2021 at 18:28
Updated 4 March 2021 at 08:18
Resolved 4 March 2021 at 08:18