views:

261

answers:

1

I'm writing a small JavaScript function to generate a date selector for use in various languages. I want to test the JavaScript date functions toUTCString, toLocaleString, toLocaleDateString in english, french, german, italian and spanish.

How do I affect the locale settings that are used by the date object. I've tried changing my windows language settings and also my web browsers. There must be a way to do this so I don't have to find a guy with a computer in each country just to test the script?

A: 

Regarding only one JavaScript function, it seems like overkill to me, but it may be possible work-around to install several virtual machines with diferent locale settings.

Sensei76
I tried changing every language and locale setting of my development machine, including my browsers to a different locale and still the JavaScript functions returned English dates. have you actually done this before and got it to work? what is it that determines the actual locale used?
Matt Smith
For virtual machines, there are a few of them available for free download, like Microsoft's Virtual PC 2007. Install the VM software and then install Windows in one of your needed language versions. Unfortunatelly, for legal use, this requires a valid Windows licencse for each installation. Yes, I have done that before and it worked fine because to the virtual machine my e.g. danish Windows was danish, no matter what the 'real' locale of my host system was. Your biggest problem may be to get hold of those other language versions. The rest is a simple Windows installation like any other.
Sensei76
Thanks I'll look into the different versions. Having done some research now it appears that Firefox doesn't actually look at the system it gets it's locale setting from it's installation. windows may only affect explorer and Chrome I'm still puzzled by.
Matt Smith