JS_SetDefaultLocale

This article covers features introduced in SpiderMonkey 24

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

Syntax

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

Description

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,