PluralRules
t
RESCRIPT
type t
localeType
RESCRIPT
type localeType = [#cardinal | #ordinal]
options
RESCRIPT
type options = {
localeMatcher?: Intl_Common.localeMatcher,
\"type"?: localeType,
minimumIntegerDigits?: Intl_Common.oneTo21,
minimumFractionDigits?: Intl_Common.zeroTo20,
maximumFractionDigits?: Intl_Common.zeroTo20,
minimumSignificantDigits?: Intl_Common.oneTo21,
maximumSignificantDigits?: Intl_Common.oneTo21,
}
pluralCategories
RESCRIPT
type pluralCategories = [
| #few
| #many
| #one
| #other
| #two
| #zero
]
resolvedOptions
RESCRIPT
type resolvedOptions = {
locale: string,
pluralCategories: array<pluralCategories>,
\"type": localeType,
minimumIntegerDigits?: Intl_Common.oneTo21,
minimumFractionDigits?: Intl_Common.zeroTo20,
maximumFractionDigits?: Intl_Common.zeroTo20,
minimumSignificantDigits?: Intl_Common.oneTo21,
maximumSignificantDigits?: Intl_Common.oneTo21,
}
supportedLocalesOptions
RESCRIPT
type supportedLocalesOptions = {
localeMatcher: Intl_Common.localeMatcher,
}
make
RESCRIPT
let make: (~locales: array<string>=?, ~options: options=?) => t
supportedLocalesOf
RESCRIPT
let supportedLocalesOf: (array<string>, ~options: supportedLocalesOptions=?) => t
resolvedOptions
RESCRIPT
let resolvedOptions: t => resolvedOptions
rule
RESCRIPT
type rule = [#few | #many | #one | #other | #two | #zero]
select
RESCRIPT
let select: (t, float) => rule
selectInt
RESCRIPT
let selectInt: (t, int) => rule
selectBigInt
RESCRIPT
let selectBigInt: (t, bigint) => rule
selectRange
RESCRIPT
let selectRange: (t, ~start: float, ~end: float) => rule
selectRangeInt
RESCRIPT
let selectRangeInt: (t, ~start: int, ~end: int) => rule
selectRangeBigInt
RESCRIPT
let selectRangeBigInt: (t, ~start: bigint, ~end: bigint) => rule
ignore
RESCRIPT
let ignore: t => unit
ignore(pluralRules)
ignores the provided pluralRules and returns unit.
This helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further.