On 12/23/2010 11:11 PM, Nando wrote:

> adding cal.getMinimalDaysInFirstWeek(), and it confirms that all of Europe
> seems to be on the ISO calender system, with Monday as the first day of the
> week and a minimum of 4 days in the first week of the year.

another piece of advice, don't hardwire if you don't have to. the minute you 
hardwire the function/app for european locales is the minute that the client 
tells you his cousin has opened a shop in montreal & you need to support en_CA, 
fr_CA locales too.

> My experience here in Europe is that many businesses use the week system in
> communications to arrange meetings. For instance, I just received an email
> seeking to schedule a meeting asking "How does week 04 or 05 look like?"

as i said "but anyways"....

> What I would like would be to pull the language and country information from
> the currently set ColdFusion locale. Do you have a handy way to accomplish
> that? Or would a UDF like this need to pass the two letter country and
> language codes into the function?

if your app is already setting the locale somehow (user choice, geoLocation, 
etc.) that would be the best way. we have a geoLocation CFC but it's ip db is 
woefully out of date (that bit is maintained by a dirty perl programmer ;-) and
passing in locale AND timezone would make that a function *i'd* use.

for locales that cf *didn't* support prior to cf7 using getLocale() will get 
you 
a core java locale ID, "th_TH", etc. which is easy to parse (treat it as a list 
delimited by "_"). the problem is locales that cf *did* support prior to cf7, 
which will return the goofy cf locale names, "English (US)" (in fact the old cf 
locales are duplicated with their new core java locales, ie in the server scope 
supported locales you'll see both English (US) & en_US). since there aren't too 
many of these & are static, i guess create a structure using those old locale 
names as keys & do a structFind on it if the locale returned by getLocale() 
doesn't contain a "_" or something like that.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340264
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to