Internal
Internal
Key-value pairs of the translation strings to use.
Optional
config: { locale?: null | string } = {}Configuration options for the function.
Optional
locale?: null | stringAn overriding locale for the PluralRules functionality.
Internal
Get the appropriate suffix for the plural form.
Uses Intl.PluralRules (or our own fallback implementation) to get the 'preferred' form to use for the given count.
Checks that a translation has been provided for that plural form – if it hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist either, in which case an error will be thrown)
The lookup key of the string to use.
Number used to determine which pluralisation to use.
The suffix associated with the correct pluralisation for this locale.
Internal
Check to see if the browser supports Intl.PluralRules
It requires all conditions to be met in order to be supported:
https://browsersl.ist/#q=supports+es6-module+and+not+supports+intl-pluralrules
Returns true if all conditions are met. Returns false otherwise.
Internal
Takes a translation string with placeholders, and replaces the placeholders with the provided data
The translation string
Any options passed with the translation string, e.g: for string interpolation.
The translation string to output, with ${} placeholders replaced
Internal
The most used function - takes the key for a given piece of UI text and returns the appropriate string.
The lookup key of the string to use.
Optional
options: { [key: string]: unknown }Any options passed with the translation string, e.g: for string interpolation.
The appropriate translation string.
Internal support for selecting messages to render, with placeholder interpolation and locale-aware number formatting and pluralisation