Please note, this is a STATIC archive of website from 03 Nov 2016, does not collect or store any user information, there is no "phishing" involved.


This article needs a technical review. How you can help.

This article covers features introduced in SpiderMonkey 24

Set and reset the default locale for the ECMAScript Internationalization API.


JS_SetDefaultLocale(JSRuntime *rt, const char *locale);

JS_ResetDefaultLocale(JSRuntime *rt);
Name Type Description
rt JSRuntime * Pointer to a JS runtime
locale const char * String represents locale.


JS_SetDefaultLocale sets the default locale for the ECMAScript Internationalization API (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).

Note that the Internationalization API encourages clients to specify their own locales.

The locale string remains owned by the caller.

JS_ResetDefaultLocale resets the default locale to OS defaults.

See Also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,