最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Change Current Locale for Testing - Stack Overflow

programmeradmin0浏览0评论

I need to change my Chrome browser's running javascript locale from English US to English UK in order to test functionality that relies on javascript's Date object. Is this based off of the browser settings? Or maybe my OS settings? I'm running on Windows 7.

I need to change my Chrome browser's running javascript locale from English US to English UK in order to test functionality that relies on javascript's Date object. Is this based off of the browser settings? Or maybe my OS settings? I'm running on Windows 7.

Share Improve this question asked Sep 26, 2014 at 14:10 Kyle V.Kyle V. 4,8029 gold badges51 silver badges87 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

The easiest way and the best way to change your chrome browser locale settings is:

  1. Just go to your desktop Google chrome shortcut, right click and properties. You will notice your target with: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

  2. Change the target to:

    "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --lang=en_US --user-data-dir=C:\ChromeUserDirs\EN_US
    

    etc. according to your locale that you would wanted to change.

As you can see I have changed my locale settings (default was English because I am living in UK) to US.

Google Chrome now supports emulating locales and locations in Developer Tools.

Old question, but just in case someone is still looking for it, what worked for me is changing the time zone of the OS. I tried this on Windows 10.

发布评论

评论列表(0)

  1. 暂无评论