How to use the intl-messageformat.defaultLocale function in intl-messageformat

To help you get started, we’ve selected a few intl-messageformat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / packages / kbn-i18n / src / core / i18n.ts View on Github external
export function setDefaultLocale(locale: string) {
  if (!locale || !isString(locale)) {
    throw new Error('[I18n] A `locale` must be a non-empty string.');
  }

  defaultLocale = normalizeLocale(locale);
  IntlMessageFormat.defaultLocale = defaultLocale;
  IntlRelativeFormat.defaultLocale = defaultLocale;
}

intl-messageformat

Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.

BSD-3-Clause
Latest version published 13 days ago

Package Health Score

100 / 100
Full package analysis