DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact
v11v9.1 - v10.1v8.2 - v9.0v6.0 - v8.1
Overview
Stdlib
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Bool
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Ref
    • Bitwise
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • IntervalId
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
    JsError
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • JsExn
  • Lazy
  • List
  • Map
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Pair
  • Promise
  • RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • TimeoutId
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • Docs / API / Intl

    Intl

    getCanonicalLocalesExn

    RESCRIPT
    let getCanonicalLocalesExn: string => array<string>

    getCanonicalLocalesExn(locale) returns the canonical form of locale.

    Throws RangeError when the locale string is malformed.

    See Intl.getCanonicalLocales on MDN.

    Examples

    RESCRIPT
    Intl.getCanonicalLocalesExn("EN-US") == ["en-US"]

    getCanonicalLocalesManyExn

    RESCRIPT
    let getCanonicalLocalesManyExn: array<string> => array<string>

    getCanonicalLocalesManyExn(locales) canonicalises every locale in locales.

    Throws RangeError when any locale string is malformed.

    See Intl.getCanonicalLocales on MDN.

    Examples

    RESCRIPT
    Intl.getCanonicalLocalesManyExn(["EN-US", "fr"]) == ["en-US", "fr"]

    supportedValuesOfExn

    RESCRIPT
    let supportedValuesOfExn: string => array<string>

    supportedValuesOfExn(key) returns the list of values supported by the runtime for the feature identified by key.

    Throws RangeError when key is unsupported.

    See Intl.supportedValuesOf on MDN.

    Examples

    RESCRIPT
    Intl.supportedValuesOfExn("calendar")->Array.includes("gregory") == true
    Types and values
    • v
      getCanonicalLocalesExn
    • v
      getCanonicalLocalesManyExn
    • v
      supportedValuesOfExn

    © 2025 The ReScript Project

    About
    • Community
    • ReScript Association
    Find us on