From 079135430fd7b551a82f9e729e7ae533287097b8 Mon Sep 17 00:00:00 2001 From: Bamieh Date: Wed, 27 Mar 2024 06:57:03 +0200 Subject: [PATCH 01/56] upgrade packages --- package.json | 13 +- packages/kbn-i18n-react/index.tsx | 13 +- .../kbn-i18n-react/src/compatiblity_layer.tsx | 11 + packages/kbn-i18n-react/src/provider.tsx | 5 +- packages/kbn-i18n/README.md | 5 - packages/kbn-i18n/index.ts | 10 - packages/kbn-i18n/src/core/i18n.test.ts | 62 ----- packages/kbn-i18n/src/core/i18n.ts | 220 +++++++----------- packages/kbn-i18n/src/core/locales.js | 46 ++-- .../instructions/cloud_instructions.ts | 6 +- .../components/editor/control_editor.tsx | 4 +- .../public/components/editor/field_select.tsx | 4 +- .../editor/index_pattern_select_form_row.tsx | 4 +- .../public/components/vis/list_control.tsx | 4 +- .../components/no_vulnerabilities_states.tsx | 5 +- .../docs_explorer/search_ui_components.tsx | 15 +- .../text_expansion_callout/deploy_model.tsx | 13 +- .../instructions/apm_agent_instructions.ts | 2 +- .../observability/server/ui_settings.ts | 11 +- yarn.lock | 163 ++++++++++--- 20 files changed, 299 insertions(+), 317 deletions(-) create mode 100644 packages/kbn-i18n-react/src/compatiblity_layer.tsx diff --git a/package.json b/package.json index 3db9941e2c39c..5a8e8a8e34063 100644 --- a/package.json +++ b/package.json @@ -123,6 +123,10 @@ "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", "@faker-js/faker": "^8.3.1", + "@formatjs/intl": "^2.10.1", + "@formatjs/intl-pluralrules": "^5.2.12", + "@formatjs/intl-relativetimeformat": "^11.2.12", + "@formatjs/intl-utils": "^3.8.4", "@grpc/grpc-js": "^1.6.8", "@hapi/accept": "^5.0.2", "@hapi/boom": "^9.1.4", @@ -1002,10 +1006,8 @@ "immer": "^9.0.21", "inquirer": "^7.3.3", "intl": "^1.2.5", - "intl-format-cache": "^2.1.0", - "intl-messageformat": "^2.2.0", + "intl-messageformat": "10.5.11", "intl-messageformat-parser": "^1.4.0", - "intl-relativeformat": "^2.1.0", "io-ts": "^2.0.5", "ipaddr.js": "2.0.0", "isbinaryfile": "4.0.2", @@ -1080,7 +1082,7 @@ "react-fast-compare": "^2.0.4", "react-grid-layout": "^1.3.4", "react-hook-form": "^7.44.2", - "react-intl": "^2.8.0", + "react-intl": "6.6.3", "react-is": "^17.0.2", "react-markdown": "^6.0.3", "react-monaco-editor": "^0.54.0", @@ -1190,6 +1192,7 @@ "@elastic/synthetics": "^1.5.0", "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/jest": "^11.11.0", + "@formatjs/cli": "^6.2.8", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@istanbuljs/schema": "^0.1.2", @@ -1697,4 +1700,4 @@ "zod-to-json-schema": "^3.22.3" }, "packageManager": "yarn@1.22.21" -} \ No newline at end of file +} diff --git a/packages/kbn-i18n-react/index.tsx b/packages/kbn-i18n-react/index.tsx index 1064a9c1a2682..2d7f55df170bb 100644 --- a/packages/kbn-i18n-react/index.tsx +++ b/packages/kbn-i18n-react/index.tsx @@ -6,21 +6,18 @@ * Side Public License, v 1. */ -// eslint-disable-next-line @kbn/eslint/module_migration -export type { InjectedIntl, InjectedIntlProps } from 'react-intl'; +export type { IntlShape, WrappedComponentProps } from '.'; export { - intlShape, FormattedDate, FormattedTime, - FormattedRelative, FormattedNumber, FormattedPlural, FormattedMessage, - FormattedHTMLMessage, - // Only used for testing. Use I18nProvider otherwise. - IntlProvider as __IntlProvider, // eslint-disable-next-line @kbn/eslint/module_migration -} from 'react-intl'; + FormattedRelativeTime, +} from '.'; + +export { injecti18n } from './src/compatiblity_layer'; export { I18nProvider } from './src/provider'; export { injectI18n } from './src/inject'; diff --git a/packages/kbn-i18n-react/src/compatiblity_layer.tsx b/packages/kbn-i18n-react/src/compatiblity_layer.tsx new file mode 100644 index 0000000000000..19ae08cd97280 --- /dev/null +++ b/packages/kbn-i18n-react/src/compatiblity_layer.tsx @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { injectIntl } from '..'; + +export const injecti18n = injectIntl; diff --git a/packages/kbn-i18n-react/src/provider.tsx b/packages/kbn-i18n-react/src/provider.tsx index 5e60188d3bdd4..a52dd8b45129c 100644 --- a/packages/kbn-i18n-react/src/provider.tsx +++ b/packages/kbn-i18n-react/src/provider.tsx @@ -12,7 +12,6 @@ import React from 'react'; import { IntlProvider } from 'react-intl'; import { i18n } from '@kbn/i18n'; -import { PseudoLocaleWrapper } from './pseudo_locale_wrapper'; /** * The library uses the provider pattern to scope an i18n context to a tree @@ -24,10 +23,10 @@ export const I18nProvider: React.FC = ({ children }) => ( - {children} + {children} ); diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index 0121524b57e84..8492d8e12537f 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -61,16 +61,11 @@ data to UI frameworks and provides methods for the direct translation. Here is the public API exposed by this engine: -- `addTranslation(newTranslation: Translation, [locale: string])` - provides a way to register -translations with the engine - `getTranslation()` - returns messages for the current language - `setLocale(locale: string)` - tells the engine which language to use by given language key - `getLocale()` - returns the current locale -- `setDefaultLocale(locale: string)` - tells the library which language to fallback when missing translations -- `getDefaultLocale()` - returns the default locale -- `setFormats(formats: object)` - supplies a set of options to the underlying formatter. For the detailed explanation, see the section below - `getFormats()` - returns current formats - `getRegisteredLocales()` - returns array of locales having translations diff --git a/packages/kbn-i18n/index.ts b/packages/kbn-i18n/index.ts index 188b4343cb0e0..2312e5d07b790 100644 --- a/packages/kbn-i18n/index.ts +++ b/packages/kbn-i18n/index.ts @@ -8,13 +8,8 @@ import { formats, - addTranslation, getTranslation, - setLocale, getLocale, - setDefaultLocale, - getDefaultLocale, - setFormats, getFormats, getRegisteredLocales, translate, @@ -35,13 +30,8 @@ import { const i18n = { formats, - addTranslation, getTranslation, - setLocale, getLocale, - setDefaultLocale, - getDefaultLocale, - setFormats, getFormats, getRegisteredLocales, translate, diff --git a/packages/kbn-i18n/src/core/i18n.test.ts b/packages/kbn-i18n/src/core/i18n.test.ts index dfea790f129b5..02466ecc5537f 100644 --- a/packages/kbn-i18n/src/core/i18n.test.ts +++ b/packages/kbn-i18n/src/core/i18n.test.ts @@ -241,57 +241,6 @@ describe('I18n engine', () => { }); }); - describe('setDefaultLocale', () => { - test('should throw error if locale is not a non-empty string', () => { - expect(() => i18n.setDefaultLocale(undefined as any)).toThrow(); - expect(() => i18n.setDefaultLocale(null as any)).toThrow(); - expect(() => i18n.setDefaultLocale(true as any)).toThrow(); - expect(() => i18n.setDefaultLocale(5 as any)).toThrow(); - expect(() => i18n.setDefaultLocale({} as any)).toThrow(); - expect(() => i18n.setDefaultLocale('')).toThrow(); - }); - - test('should update the default locale', () => { - expect(i18n.getDefaultLocale()).not.toBe('foo'); - i18n.setDefaultLocale('foo'); - expect(i18n.getDefaultLocale()).toBe('foo'); - }); - - test('should normalize passed locale', () => { - i18n.setDefaultLocale('en-US'); - expect(i18n.getDefaultLocale()).toBe('en-us'); - }); - - test('should set "en" locale as default for IntlMessageFormat and IntlRelativeFormat', () => { - const IntlMessageFormat = require('intl-messageformat'); - const IntlRelativeFormat = require('intl-relativeformat'); - - expect(IntlMessageFormat.defaultLocale).toBe('en'); - expect(IntlRelativeFormat.defaultLocale).toBe('en'); - }); - - test('should update defaultLocale for IntlMessageFormat and IntlRelativeFormat', () => { - const IntlMessageFormat = require('intl-messageformat'); - const IntlRelativeFormat = require('intl-relativeformat'); - - i18n.setDefaultLocale('foo'); - - expect(IntlMessageFormat.defaultLocale).toBe('foo'); - expect(IntlRelativeFormat.defaultLocale).toBe('foo'); - }); - }); - - describe('getDefaultLocale', () => { - test('should return "en" locale by default', () => { - expect(i18n.getDefaultLocale()).toBe('en'); - }); - - test('should return updated locale', () => { - i18n.setDefaultLocale('foo'); - expect(i18n.getDefaultLocale()).toBe('foo'); - }); - }); - describe('setFormats', () => { test('should throw error if formats parameter is not a non-empty object', () => { expect(() => i18n.setFormats(undefined as any)).toThrow(); @@ -497,8 +446,6 @@ describe('I18n engine', () => { }); test('should format pluralized default messages', () => { - i18n.setDefaultLocale('en'); - expect( i18n.translate('a.b.c', { values: { numPhotos: 0 }, @@ -544,7 +491,6 @@ describe('I18n engine', () => { }`, }, }); - i18n.setDefaultLocale('en'); expect(() => i18n.translate('a.b.c', { values: { foo: 0 } } as any) @@ -569,7 +515,6 @@ describe('I18n engine', () => { ['a.b.c']: 'Result: {result, number, percent}', }, }); - i18n.setDefaultLocale('en'); expect(i18n.translate('a.b.c', { values: { result: 0.15 } } as any)).toBe('Result: 15%'); @@ -618,8 +563,6 @@ describe('I18n engine', () => { }); test('should format default messages with date formatter', () => { - i18n.setDefaultLocale('en'); - expect( i18n.translate('foo', { defaultMessage: 'Sale begins {start, date, short}', @@ -672,8 +615,6 @@ describe('I18n engine', () => { }); test('should format default messages with time formatter', () => { - i18n.setDefaultLocale('en'); - expect( i18n.translate('foo', { defaultMessage: 'Coupon expires at {expires, time, short}', @@ -732,7 +673,6 @@ describe('I18n engine', () => { }, messages: {}, }); - i18n.setDefaultLocale('en'); expect( i18n.translate('a.b.c', { @@ -769,7 +709,6 @@ describe('I18n engine', () => { ['a.b.c']: 'Your total is {total, number, usd}', }, }); - i18n.setDefaultLocale('en'); expect(i18n.translate('a.b.c', { values: { total: 1000 } } as any)).toBe( 'Your total is 1,000' @@ -790,7 +729,6 @@ describe('I18n engine', () => { ['a.b.c']: 'Your total is {total, foo}', }, }); - i18n.setDefaultLocale('en'); expect(() => i18n.translate('a.b.c', { values: { total: 1 } } as any) diff --git a/packages/kbn-i18n/src/core/i18n.ts b/packages/kbn-i18n/src/core/i18n.ts index 1fa0ceb997410..3d0cfb4f8470d 100644 --- a/packages/kbn-i18n/src/core/i18n.ts +++ b/packages/kbn-i18n/src/core/i18n.ts @@ -6,37 +6,34 @@ * Side Public License, v 1. */ -import memoizeIntlConstructor from 'intl-format-cache'; -import IntlMessageFormat from 'intl-messageformat'; -import IntlRelativeFormat from 'intl-relativeformat'; +import { createIntl, createIntlCache } from '@formatjs/intl'; +import type { MessageDescriptor } from '@formatjs/intl'; + +import type { + PrimitiveType, + FormatXMLElementFn, + Options as IntlMessageFormatOptions, +} from 'intl-messageformat'; import { Translation } from '../translation'; -import { Formats, formats as EN_FORMATS } from './formats'; -import { hasValues, isObject, isString, mergeAll } from './helper'; -import { isPseudoLocale, translateUsingPseudoLocale } from './pseudo_locale'; // Add all locale data to `IntlMessageFormat`. import './locales'; const EN_LOCALE = 'en'; -const translationsForLocale: Record = {}; -const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat); +const defaultLocale = EN_LOCALE; +const currentLocale = EN_LOCALE; -let defaultLocale = EN_LOCALE; -let currentLocale = EN_LOCALE; -let formats = EN_FORMATS; - -IntlMessageFormat.defaultLocale = defaultLocale; -IntlRelativeFormat.defaultLocale = defaultLocale; +const translationsForLocale: Record = {}; -/** - * Returns message by the given message id. - * @param id - path to the message - */ -function getMessageById(id: string): string | undefined { - const translation = getTranslation(); - return translation.messages ? translation.messages[id] : undefined; -} +const cache = createIntlCache(); +let intl = createIntl( + { + locale: defaultLocale, + messages: {}, + }, + cache +); /** * Normalizes locale to make it consistent with IntlMessageFormat locales @@ -51,47 +48,29 @@ function normalizeLocale(locale: string) { * @param newTranslation * @param [locale = messages.locale] */ -export function addTranslation(newTranslation: Translation, locale = newTranslation.locale) { - if (!locale || !isString(locale)) { +export function addTranslation(newTranslation: Translation) { + if (!newTranslation.locale || typeof newTranslation.locale !== 'string') { throw new Error('[I18n] A `locale` must be a non-empty string to add messages.'); } + const { locale } = newTranslation; - if (newTranslation.locale && newTranslation.locale !== locale) { - throw new Error( - '[I18n] A `locale` in the translation object is different from the one provided as a second argument.' - ); - } - - const normalizedLocale = normalizeLocale(locale); - const existingTranslation = translationsForLocale[normalizedLocale] || { messages: {} }; - - translationsForLocale[normalizedLocale] = { - formats: newTranslation.formats || existingTranslation.formats, - locale: newTranslation.locale || existingTranslation.locale, - messages: { - ...existingTranslation.messages, - ...newTranslation.messages, + intl = createIntl( + { + locale, + messages: newTranslation.messages, + formats: newTranslation.formats, }, - }; + cache + ); } /** * Returns messages for the current language */ export function getTranslation(): Translation { - return translationsForLocale[currentLocale] || { messages: {} }; -} - -/** - * Tells the engine which language to use by given language key - * @param locale - */ -export function setLocale(locale: string) { - if (!locale || !isString(locale)) { - throw new Error('[I18n] A `locale` must be a non-empty string.'); - } - - currentLocale = normalizeLocale(locale); + return { + messages: intl.messages, + }; } /** @@ -101,48 +80,11 @@ export function getLocale() { return currentLocale; } -/** - * Tells the library which language to fallback when missing translations - * @param locale - */ -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; -} - -export function getDefaultLocale() { - return defaultLocale; -} - -/** - * Supplies a set of options to the underlying formatter - * [Default format options used as the prototype of the formats] - * {@link https://github.com/yahoo/intl-messageformat/blob/master/src/core.js#L62} - * These are used when constructing the internal Intl.NumberFormat - * and Intl.DateTimeFormat instances. - * @param newFormats - * @param [newFormats.number] - * @param [newFormats.date] - * @param [newFormats.time] - */ -export function setFormats(newFormats: Formats) { - if (!isObject(newFormats) || !hasValues(newFormats)) { - throw new Error('[I18n] A `formats` must be a non-empty object.'); - } - - formats = mergeAll(formats, newFormats); -} - /** * Returns current formats */ export function getFormats() { - return formats; + return intl.formats; } /** @@ -153,9 +95,10 @@ export function getRegisteredLocales() { } export interface TranslateArguments { - values?: Record; - defaultMessage: string; - description?: string; + defaultMessage: MessageDescriptor['defaultMessage']; + description?: MessageDescriptor['description']; + values?: Record>; + options?: IntlMessageFormatOptions; } /** @@ -166,45 +109,54 @@ export interface TranslateArguments { * @param [options.defaultMessage] - will be used unless translation was successful */ export function translate(id: string, { values = {}, defaultMessage }: TranslateArguments): string { - const shouldUsePseudoLocale = isPseudoLocale(currentLocale); + // const shouldUsePseudoLocale = isPseudoLocale(currentLocale); - if (!id || !isString(id)) { + if (!id || typeof id !== 'string') { throw new Error('[I18n] An `id` must be a non-empty string to translate a message.'); } - const message = shouldUsePseudoLocale ? defaultMessage : getMessageById(id); - - if (!message && !defaultMessage) { - throw new Error(`[I18n] Cannot format message: "${id}". Default message must be provided.`); - } - - if (message) { - try { - // We should call `format` even for messages without any value references - // to let it handle escaped curly braces `\\{` that are the part of the text itself - // and not value reference boundaries. - const formattedMessage = getMessageFormat(message, getLocale(), getFormats()).format(values); - - return shouldUsePseudoLocale - ? translateUsingPseudoLocale(formattedMessage) - : formattedMessage; - } catch (e) { - throw new Error( - `[I18n] Error formatting message: "${id}" for locale: "${getLocale()}".\n${e}` - ); - } - } - - try { - const msg = getMessageFormat(defaultMessage, getDefaultLocale(), getFormats()); - - return msg.format(values); - } catch (e) { - throw new Error(`[I18n] Error formatting the default message for: "${id}".\n${e}`); - } + return intl.formatMessage( + { + id, + defaultMessage, + }, + values + ); + + // const message = shouldUsePseudoLocale ? defaultMessage : getMessageById(id); + + // if (!message && !defaultMessage) { + // throw new Error(`[I18n] Cannot format message: "${id}". Default message must be provided.`); + // } + + // if (message) { + // try { + // // We should call `format` even for messages without any value references + // // to let it handle escaped curly braces `\\{` that are the part of the text itself + // // and not value reference boundaries. + // const formattedMessage = getMessageFormat(message, getLocale(), getFormats()).format(values); + + // return shouldUsePseudoLocale + // ? translateUsingPseudoLocale(formattedMessage) + // : formattedMessage; + // } catch (e) { + // throw new Error( + // `[I18n] Error formatting message: "${id}" for locale: "${getLocale()}".\n${e}` + // ); + // } + // } + + // try { + // const msg = getMessageFormat(defaultMessage, currentLocale, getFormats()); + + // return msg.format(values); + // } catch (e) { + // throw new Error(`[I18n] Error formatting the default message for: "${id}".\n${e}`); + // } } /** + * REMOVE * Initializes the engine * @param newTranslation */ @@ -214,14 +166,6 @@ export function init(newTranslation?: Translation) { } addTranslation(newTranslation); - - if (newTranslation.locale) { - setLocale(newTranslation.locale); - } - - if (newTranslation.formats) { - setFormats(newTranslation.formats); - } } /** @@ -239,5 +183,11 @@ export async function load(translationsUrl: string) { throw new Error(`Translations request failed with status code: ${response.status}`); } - init(await response.json()); + const newTranslation = await response.json(); + + if (!newTranslation || !Object.keys(newTranslation.messages).length) { + return; + } + + addTranslation(newTranslation); } diff --git a/packages/kbn-i18n/src/core/locales.js b/packages/kbn-i18n/src/core/locales.js index 44f6bd6c6bd80..fc948d648d61d 100644 --- a/packages/kbn-i18n/src/core/locales.js +++ b/packages/kbn-i18n/src/core/locales.js @@ -1,30 +1,28 @@ /* eslint-disable @kbn/eslint/require-license-header,prettier/prettier,eqeqeq,no-nested-ternary,one-var,no-var */ -// Copied from https://github.com/yahoo/intl-relativeformat/tree/master/dist/locale-data +// https://formatjs.io/docs/polyfills/intl-pluralrules/ +require('@formatjs/intl-pluralrules/polyfill'); +require('@formatjs/intl-pluralrules/locale-data/en'); +require('@formatjs/intl-pluralrules/locale-data/zh'); +require('@formatjs/intl-pluralrules/locale-data/ja'); +require('@formatjs/intl-pluralrules/locale-data/fr'); -import IntlMessageFormat from 'intl-messageformat'; -import IntlRelativeFormat from 'intl-relativeformat'; -function addLocaleData(localeData) { - IntlMessageFormat.__addLocaleData(localeData); - IntlRelativeFormat.__addLocaleData(localeData); -} +require('@formatjs/intl-relativetimeformat/polyfill') +require('@formatjs/intl-relativetimeformat/locale-data/en'); +require('@formatjs/intl-relativetimeformat/locale-data/zh'); +require('@formatjs/intl-relativetimeformat/locale-data/ja'); +require('@formatjs/intl-relativetimeformat/locale-data/fr'); -addLocaleData({ locale: "en", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"year-short":{"displayName":"yr.","relative":{"0":"this yr.","1":"next yr.","-1":"last yr."},"relativeTime":{"future":{"one":"in {0} yr.","other":"in {0} yr."},"past":{"one":"{0} yr. ago","other":"{0} yr. ago"}}},"month":{"displayName":"month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"month-short":{"displayName":"mo.","relative":{"0":"this mo.","1":"next mo.","-1":"last mo."},"relativeTime":{"future":{"one":"in {0} mo.","other":"in {0} mo."},"past":{"one":"{0} mo. ago","other":"{0} mo. ago"}}},"day":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"day-short":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"hour","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"hour-short":{"displayName":"hr.","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hr.","other":"in {0} hr."},"past":{"one":"{0} hr. ago","other":"{0} hr. ago"}}},"minute":{"displayName":"minute","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"minute-short":{"displayName":"min.","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} min.","other":"in {0} min."},"past":{"one":"{0} min. ago","other":"{0} min. ago"}}},"second":{"displayName":"second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}},"second-short":{"displayName":"sec.","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} sec.","other":"in {0} sec."},"past":{"one":"{0} sec. ago","other":"{0} sec. ago"}}}} }); -addLocaleData({ locale: "en-US", parentLocale: "en" }); -addLocaleData({ locale: "en-xa", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}, "fields":{"year":{"displayName":"ýéààŕ","relative":{"0":"ţĥîîš ýééàŕ","1":"ñéẋẋţ ýééàŕ","-1":"ļàššţ ýééàŕ"},"relativeTime":{"future":{"one":"îñ {0} ýýéàŕŕ","other":"îñ {0} ýýéàŕŕš"},"past":{"one":"{0} ýéààŕ àĝĝô","other":"{0} ýéààŕš ààĝô"}}},"year-short":{"displayName":"ýŕ.","relative":{"0":"ţĥîîš ýŕŕ.","1":"ñéẋẋţ ýŕŕ.","-1":"ļàššţ ýŕŕ."},"relativeTime":{"future":{"one":"îñ {0} ýýŕ.","other":"îñ {0} ýýŕ."},"past":{"one":"{0} ýŕ. ààĝô","other":"{0} ýŕ. ààĝô"}}},"month":{"displayName":"ɱôññţĥ","relative":{"0":"ţĥîîš ɱôôñţĥĥ","1":"ñéẋẋţ ɱôôñţĥĥ","-1":"ļàššţ ɱôôñţĥĥ"},"relativeTime":{"future":{"one":"îñ {0} ɱɱôñţţĥ","other":"îñ {0} ɱɱôñţţĥš"},"past":{"one":"{0} ɱôññţĥ ààĝô","other":"{0} ɱôññţĥšš àĝôô"}}},"month-short":{"displayName":"ɱô.","relative":{"0":"ţĥîîš ɱôô.","1":"ñéẋẋţ ɱôô.","-1":"ļàššţ ɱôô."},"relativeTime":{"future":{"one":"îñ {0} ɱɱô.","other":"îñ {0} ɱɱô."},"past":{"one":"{0} ɱô. ààĝô","other":"{0} ɱô. ààĝô"}}},"day":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"day-short":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"hour":{"displayName":"ĥôûûŕ","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥôûŕŕ","other":"îñ {0} ĥĥôûŕŕš"},"past":{"one":"{0} ĥôûûŕ àĝĝô","other":"{0} ĥôûûŕš ààĝô"}}},"hour-short":{"displayName":"ĥŕ.","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥŕ.","other":"îñ {0} ĥĥŕ."},"past":{"one":"{0} ĥŕ. ààĝô","other":"{0} ĥŕ. ààĝô"}}},"minute":{"displayName":"ɱîññûţéé","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñûûţé","other":"îñ {0} ɱɱîñûûţéšš"},"past":{"one":"{0} ɱîññûţéé àĝôô","other":"{0} ɱîññûţééš àĝĝô"}}},"minute-short":{"displayName":"ɱîññ.","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñ.","other":"îñ {0} ɱɱîñ."},"past":{"one":"{0} ɱîññ. àĝôô","other":"{0} ɱîññ. àĝôô"}}},"second":{"displayName":"šéççôñðð","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéçôôñð","other":"îñ {0} ššéçôôñðšš"},"past":{"one":"{0} šéççôñðð àĝôô","other":"{0} šéççôñððš àĝĝô"}}},"second-short":{"displayName":"šéçç.","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéç.","other":"îñ {0} ššéç."},"past":{"one":"{0} šéçç. àĝôô","other":"{0} šéçç. àĝôô"}}}} }); -addLocaleData({ locale: "es", pluralRuleFunction: function (n,ord){if(ord)return"other";return n==1?"one":"other"},"fields":{"year":{"displayName":"año","relative":{"0":"este año","1":"el próximo año","-1":"el año pasado"},"relativeTime":{"future":{"one":"dentro de {0} año","other":"dentro de {0} años"},"past":{"one":"hace {0} año","other":"hace {0} años"}}},"year-short":{"displayName":"a","relative":{"0":"este año","1":"el próximo año","-1":"el año pasado"},"relativeTime":{"future":{"one":"dentro de {0} a","other":"dentro de {0} a"},"past":{"one":"hace {0} a","other":"hace {0} a"}}},"month":{"displayName":"mes","relative":{"0":"este mes","1":"el próximo mes","-1":"el mes pasado"},"relativeTime":{"future":{"one":"dentro de {0} mes","other":"dentro de {0} meses"},"past":{"one":"hace {0} mes","other":"hace {0} meses"}}},"month-short":{"displayName":"m","relative":{"0":"este mes","1":"el próximo mes","-1":"el mes pasado"},"relativeTime":{"future":{"one":"dentro de {0} m","other":"dentro de {0} m"},"past":{"one":"hace {0} m","other":"hace {0} m"}}},"day":{"displayName":"día","relative":{"0":"hoy","1":"mañana","2":"pasado mañana","-2":"anteayer","-1":"ayer"},"relativeTime":{"future":{"one":"dentro de {0} día","other":"dentro de {0} días"},"past":{"one":"hace {0} día","other":"hace {0} días"}}},"day-short":{"displayName":"d","relative":{"0":"hoy","1":"mañana","2":"pasado mañana","-2":"anteayer","-1":"ayer"},"relativeTime":{"future":{"one":"dentro de {0} día","other":"dentro de {0} días"},"past":{"one":"hace {0} día","other":"hace {0} días"}}},"hour":{"displayName":"hora","relative":{"0":"esta hora"},"relativeTime":{"future":{"one":"dentro de {0} hora","other":"dentro de {0} horas"},"past":{"one":"hace {0} hora","other":"hace {0} horas"}}},"hour-short":{"displayName":"h","relative":{"0":"esta hora"},"relativeTime":{"future":{"one":"dentro de {0} h","other":"dentro de {0} h"},"past":{"one":"hace {0} h","other":"hace {0} h"}}},"minute":{"displayName":"minuto","relative":{"0":"este minuto"},"relativeTime":{"future":{"one":"dentro de {0} minuto","other":"dentro de {0} minutos"},"past":{"one":"hace {0} minuto","other":"hace {0} minutos"}}},"minute-short":{"displayName":"min","relative":{"0":"este minuto"},"relativeTime":{"future":{"one":"dentro de {0} min","other":"dentro de {0} min"},"past":{"one":"hace {0} min","other":"hace {0} min"}}},"second":{"displayName":"segundo","relative":{"0":"ahora"},"relativeTime":{"future":{"one":"dentro de {0} segundo","other":"dentro de {0} segundos"},"past":{"one":"hace {0} segundo","other":"hace {0} segundos"}}},"second-short":{"displayName":"s","relative":{"0":"ahora"},"relativeTime":{"future":{"one":"dentro de {0} s","other":"dentro de {0} s"},"past":{"one":"hace {0} s","other":"hace {0} s"}}}} }); -addLocaleData({ locale: "es-LA", parentLocale: "es" }); -addLocaleData({ locale: "fr", pluralRuleFunction: function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"},"fields":{"year":{"displayName":"année","relative":{"0":"cette année","1":"l’année prochaine","-1":"l’année dernière"},"relativeTime":{"future":{"one":"dans {0} an","other":"dans {0} ans"},"past":{"one":"il y a {0} an","other":"il y a {0} ans"}}},"year-short":{"displayName":"an","relative":{"0":"cette année","1":"l’année prochaine","-1":"l’année dernière"},"relativeTime":{"future":{"one":"dans {0} a","other":"dans {0} a"},"past":{"one":"il y a {0} a","other":"il y a {0} a"}}},"month":{"displayName":"mois","relative":{"0":"ce mois-ci","1":"le mois prochain","-1":"le mois dernier"},"relativeTime":{"future":{"one":"dans {0} mois","other":"dans {0} mois"},"past":{"one":"il y a {0} mois","other":"il y a {0} mois"}}},"month-short":{"displayName":"m.","relative":{"0":"ce mois-ci","1":"le mois prochain","-1":"le mois dernier"},"relativeTime":{"future":{"one":"dans {0} m.","other":"dans {0} m."},"past":{"one":"il y a {0} m.","other":"il y a {0} m."}}},"day":{"displayName":"jour","relative":{"0":"aujourd’hui","1":"demain","2":"après-demain","-2":"avant-hier","-1":"hier"},"relativeTime":{"future":{"one":"dans {0} jour","other":"dans {0} jours"},"past":{"one":"il y a {0} jour","other":"il y a {0} jours"}}},"day-short":{"displayName":"j","relative":{"0":"aujourd’hui","1":"demain","2":"après-demain","-2":"avant-hier","-1":"hier"},"relativeTime":{"future":{"one":"dans {0} j","other":"dans {0} j"},"past":{"one":"il y a {0} j","other":"il y a {0} j"}}},"hour":{"displayName":"heure","relative":{"0":"cette heure-ci"},"relativeTime":{"future":{"one":"dans {0} heure","other":"dans {0} heures"},"past":{"one":"il y a {0} heure","other":"il y a {0} heures"}}},"hour-short":{"displayName":"h","relative":{"0":"cette heure-ci"},"relativeTime":{"future":{"one":"dans {0} h","other":"dans {0} h"},"past":{"one":"il y a {0} h","other":"il y a {0} h"}}},"minute":{"displayName":"minute","relative":{"0":"cette minute-ci"},"relativeTime":{"future":{"one":"dans {0} minute","other":"dans {0} minutes"},"past":{"one":"il y a {0} minute","other":"il y a {0} minutes"}}},"minute-short":{"displayName":"min","relative":{"0":"cette minute-ci"},"relativeTime":{"future":{"one":"dans {0} min","other":"dans {0} min"},"past":{"one":"il y a {0} min","other":"il y a {0} min"}}},"second":{"displayName":"seconde","relative":{"0":"maintenant"},"relativeTime":{"future":{"one":"dans {0} seconde","other":"dans {0} secondes"},"past":{"one":"il y a {0} seconde","other":"il y a {0} secondes"}}},"second-short":{"displayName":"s","relative":{"0":"maintenant"},"relativeTime":{"future":{"one":"dans {0} s","other":"dans {0} s"},"past":{"one":"il y a {0} s","other":"il y a {0} s"}}}} }); -addLocaleData({ locale: "fr-FR", parentLocale: "fr" }); -addLocaleData({ locale: "de", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"Jahr","relative":{"0":"dieses Jahr","1":"nächstes Jahr","-1":"letztes Jahr"},"relativeTime":{"future":{"one":"in {0} Jahr","other":"in {0} Jahren"},"past":{"one":"vor {0} Jahr","other":"vor {0} Jahren"}}},"year-short":{"displayName":"Jahr","relative":{"0":"dieses Jahr","1":"nächstes Jahr","-1":"letztes Jahr"},"relativeTime":{"future":{"one":"in {0} Jahr","other":"in {0} Jahren"},"past":{"one":"vor {0} Jahr","other":"vor {0} Jahren"}}},"month":{"displayName":"Monat","relative":{"0":"diesen Monat","1":"nächsten Monat","-1":"letzten Monat"},"relativeTime":{"future":{"one":"in {0} Monat","other":"in {0} Monaten"},"past":{"one":"vor {0} Monat","other":"vor {0} Monaten"}}},"month-short":{"displayName":"Monat","relative":{"0":"diesen Monat","1":"nächsten Monat","-1":"letzten Monat"},"relativeTime":{"future":{"one":"in {0} Monat","other":"in {0} Monaten"},"past":{"one":"vor {0} Monat","other":"vor {0} Monaten"}}},"day":{"displayName":"Tag","relative":{"0":"heute","1":"morgen","2":"übermorgen","-2":"vorgestern","-1":"gestern"},"relativeTime":{"future":{"one":"in {0} Tag","other":"in {0} Tagen"},"past":{"one":"vor {0} Tag","other":"vor {0} Tagen"}}},"day-short":{"displayName":"Tag","relative":{"0":"heute","1":"morgen","2":"übermorgen","-2":"vorgestern","-1":"gestern"},"relativeTime":{"future":{"one":"in {0} Tag","other":"in {0} Tagen"},"past":{"one":"vor {0} Tag","other":"vor {0} Tagen"}}},"hour":{"displayName":"Stunde","relative":{"0":"in dieser Stunde"},"relativeTime":{"future":{"one":"in {0} Stunde","other":"in {0} Stunden"},"past":{"one":"vor {0} Stunde","other":"vor {0} Stunden"}}},"hour-short":{"displayName":"Std.","relative":{"0":"in dieser Stunde"},"relativeTime":{"future":{"one":"in {0} Std.","other":"in {0} Std."},"past":{"one":"vor {0} Std.","other":"vor {0} Std."}}},"minute":{"displayName":"Minute","relative":{"0":"in dieser Minute"},"relativeTime":{"future":{"one":"in {0} Minute","other":"in {0} Minuten"},"past":{"one":"vor {0} Minute","other":"vor {0} Minuten"}}},"minute-short":{"displayName":"Min.","relative":{"0":"in dieser Minute"},"relativeTime":{"future":{"one":"in {0} Min.","other":"in {0} Min."},"past":{"one":"vor {0} Min.","other":"vor {0} Min."}}},"second":{"displayName":"Sekunde","relative":{"0":"jetzt"},"relativeTime":{"future":{"one":"in {0} Sekunde","other":"in {0} Sekunden"},"past":{"one":"vor {0} Sekunde","other":"vor {0} Sekunden"}}},"second-short":{"displayName":"Sek.","relative":{"0":"jetzt"},"relativeTime":{"future":{"one":"in {0} Sek.","other":"in {0} Sek."},"past":{"one":"vor {0} Sek.","other":"vor {0} Sek."}}}} }); -addLocaleData({ locale: "de-DE", parentLocale: "de" }); -addLocaleData({ locale: "ja", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"年","relative":{"0":"今年","1":"翌年","-1":"昨年"},"relativeTime":{"future":{"other":"{0} 年後"},"past":{"other":"{0} 年前"}}},"year-short":{"displayName":"年","relative":{"0":"今年","1":"翌年","-1":"昨年"},"relativeTime":{"future":{"other":"{0} 年後"},"past":{"other":"{0} 年前"}}},"month":{"displayName":"月","relative":{"0":"今月","1":"翌月","-1":"先月"},"relativeTime":{"future":{"other":"{0} か月後"},"past":{"other":"{0} か月前"}}},"month-short":{"displayName":"月","relative":{"0":"今月","1":"翌月","-1":"先月"},"relativeTime":{"future":{"other":"{0} か月後"},"past":{"other":"{0} か月前"}}},"day":{"displayName":"日","relative":{"0":"今日","1":"明日","2":"明後日","-2":"一昨日","-1":"昨日"},"relativeTime":{"future":{"other":"{0} 日後"},"past":{"other":"{0} 日前"}}},"day-short":{"displayName":"日","relative":{"0":"今日","1":"明日","2":"明後日","-2":"一昨日","-1":"昨日"},"relativeTime":{"future":{"other":"{0} 日後"},"past":{"other":"{0} 日前"}}},"hour":{"displayName":"時","relative":{"0":"1 時間以内"},"relativeTime":{"future":{"other":"{0} 時間後"},"past":{"other":"{0} 時間前"}}},"hour-short":{"displayName":"時","relative":{"0":"1 時間以内"},"relativeTime":{"future":{"other":"{0} 時間後"},"past":{"other":"{0} 時間前"}}},"minute":{"displayName":"分","relative":{"0":"1 分以内"},"relativeTime":{"future":{"other":"{0} 分後"},"past":{"other":"{0} 分前"}}},"minute-short":{"displayName":"分","relative":{"0":"1 分以内"},"relativeTime":{"future":{"other":"{0} 分後"},"past":{"other":"{0} 分前"}}},"second":{"displayName":"秒","relative":{"0":"今"},"relativeTime":{"future":{"other":"{0} 秒後"},"past":{"other":"{0} 秒前"}}},"second-short":{"displayName":"秒","relative":{"0":"今"},"relativeTime":{"future":{"other":"{0} 秒後"},"past":{"other":"{0} 秒前"}}}} }); -addLocaleData({ locale: "ja-JP", parentLocale: "ja" }); -addLocaleData({ locale: "ko", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"년","relative":{"0":"올해","1":"내년","-1":"작년"},"relativeTime":{"future":{"other":"{0}년 후"},"past":{"other":"{0}년 전"}}},"year-short":{"displayName":"년","relative":{"0":"올해","1":"내년","-1":"작년"},"relativeTime":{"future":{"other":"{0}년 후"},"past":{"other":"{0}년 전"}}},"month":{"displayName":"월","relative":{"0":"이번 달","1":"다음 달","-1":"지난달"},"relativeTime":{"future":{"other":"{0}개월 후"},"past":{"other":"{0}개월 전"}}},"month-short":{"displayName":"월","relative":{"0":"이번 달","1":"다음 달","-1":"지난달"},"relativeTime":{"future":{"other":"{0}개월 후"},"past":{"other":"{0}개월 전"}}},"day":{"displayName":"일","relative":{"0":"오늘","1":"내일","2":"모레","-2":"그저께","-1":"어제"},"relativeTime":{"future":{"other":"{0}일 후"},"past":{"other":"{0}일 전"}}},"day-short":{"displayName":"일","relative":{"0":"오늘","1":"내일","2":"모레","-2":"그저께","-1":"어제"},"relativeTime":{"future":{"other":"{0}일 후"},"past":{"other":"{0}일 전"}}},"hour":{"displayName":"시","relative":{"0":"현재 시간"},"relativeTime":{"future":{"other":"{0}시간 후"},"past":{"other":"{0}시간 전"}}},"hour-short":{"displayName":"시","relative":{"0":"현재 시간"},"relativeTime":{"future":{"other":"{0}시간 후"},"past":{"other":"{0}시간 전"}}},"minute":{"displayName":"분","relative":{"0":"현재 분"},"relativeTime":{"future":{"other":"{0}분 후"},"past":{"other":"{0}분 전"}}},"minute-short":{"displayName":"분","relative":{"0":"현재 분"},"relativeTime":{"future":{"other":"{0}분 후"},"past":{"other":"{0}분 전"}}},"second":{"displayName":"초","relative":{"0":"지금"},"relativeTime":{"future":{"other":"{0}초 후"},"past":{"other":"{0}초 전"}}},"second-short":{"displayName":"초","relative":{"0":"지금"},"relativeTime":{"future":{"other":"{0}초 후"},"past":{"other":"{0}초 전"}}}} }); -addLocaleData({ locale: "ko-KR", parentLocale: "ko" }); -addLocaleData({ locale: "pt", pluralRuleFunction: function (n,ord){if(ord)return"other";return n==1?"one":"other"},"fields":{"year":{"displayName":"ano","relative":{"0":"este ano","1":"próximo ano","-1":"ano passado"},"relativeTime":{"future":{"one":"em {0} ano","other":"em {0} anos"},"past":{"one":"há {0} ano","other":"há {0} anos"}}},"year-short":{"displayName":"a","relative":{"0":"este ano","1":"próximo ano","-1":"último ano"},"relativeTime":{"future":{"one":"em {0} ano","other":"em {0} anos"},"past":{"one":"há {0} ano","other":"há {0} anos"}}},"month":{"displayName":"mês","relative":{"0":"este mês","1":"próximo mês","-1":"mês passado"},"relativeTime":{"future":{"one":"em {0} mês","other":"em {0} meses"},"past":{"one":"há {0} mês","other":"há {0} meses"}}},"month-short":{"displayName":"m","relative":{"0":"este mês","1":"próximo mês","-1":"último mês"},"relativeTime":{"future":{"one":"em {0} mês","other":"em {0} meses"},"past":{"one":"há {0} mês","other":"há {0} meses"}}},"day":{"displayName":"dia","relative":{"0":"hoje","1":"amanhã","-1":"ontem"},"relativeTime":{"future":{"one":"em {0} dia","other":"em {0} dias"},"past":{"one":"há {0} dia","other":"há {0} dias"}}},"day-short":{"displayName":"d","relative":{"0":"hoje","1":"amanhã","-1":"ontem"},"relativeTime":{"future":{"one":"em {0} dia","other":"em {0} dias"},"past":{"one":"há {0} dia","other":"há {0} dias"}}},"hour":{"displayName":"hora","relative":{"0":"nesta hora"},"relativeTime":{"future":{"one":"em {0} hora","other":"em {0} horas"},"past":{"one":"há {0} hora","other":"há {0} horas"}}},"hour-short":{"displayName":"h","relative":{"0":"nesta hora"},"relativeTime":{"future":{"one":"em {0} h","other":"em {0} h"},"past":{"one":"há {0} h","other":"há {0} h"}}},"minute":{"displayName":"minuto","relative":{"0":"neste minuto"},"relativeTime":{"future":{"one":"em {0} minuto","other":"em {0} minutos"},"past":{"one":"há {0} minuto","other":"há {0} minutos"}}},"minute-short":{"displayName":"min","relative":{"0":"neste minuto"},"relativeTime":{"future":{"one":"em {0} min","other":"em {0} min"},"past":{"one":"há {0} min","other":"há {0} min"}}},"second":{"displayName":"segundo","relative":{"0":"agora"},"relativeTime":{"future":{"one":"em {0} segundo","other":"em {0} segundos"},"past":{"one":"há {0} segundo","other":"há {0} segundos"}}},"second-short":{"displayName":"s","relative":{"0":"agora"},"relativeTime":{"future":{"one":"em {0} s","other":"em {0} s"},"past":{"one":"há {0} s","other":"há {0} s"}}}} }); -addLocaleData({ locale: "pt-BR", parentLocale: "pt" }); -addLocaleData({ locale: "zh", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"年","relative":{"0":"今年","1":"明年","-1":"去年"},"relativeTime":{"future":{"other":"{0}年后"},"past":{"other":"{0}年前"}}},"year-short":{"displayName":"年","relative":{"0":"今年","1":"明年","-1":"去年"},"relativeTime":{"future":{"other":"{0}年后"},"past":{"other":"{0}年前"}}},"month":{"displayName":"月","relative":{"0":"本月","1":"下个月","-1":"上个月"},"relativeTime":{"future":{"other":"{0}个月后"},"past":{"other":"{0}个月前"}}},"month-short":{"displayName":"月","relative":{"0":"本月","1":"下个月","-1":"上个月"},"relativeTime":{"future":{"other":"{0}个月后"},"past":{"other":"{0}个月前"}}},"day":{"displayName":"日","relative":{"0":"今天","1":"明天","2":"后天","-2":"前天","-1":"昨天"},"relativeTime":{"future":{"other":"{0}天后"},"past":{"other":"{0}天前"}}},"day-short":{"displayName":"日","relative":{"0":"今天","1":"明天","2":"后天","-2":"前天","-1":"昨天"},"relativeTime":{"future":{"other":"{0}天后"},"past":{"other":"{0}天前"}}},"hour":{"displayName":"小时","relative":{"0":"这一时间 \u002F 此时"},"relativeTime":{"future":{"other":"{0}小时后"},"past":{"other":"{0}小时前"}}},"hour-short":{"displayName":"小时","relative":{"0":"这一时间 \u002F 此时"},"relativeTime":{"future":{"other":"{0}小时后"},"past":{"other":"{0}小时前"}}},"minute":{"displayName":"分钟","relative":{"0":"此刻"},"relativeTime":{"future":{"other":"{0}分钟后"},"past":{"other":"{0}分钟前"}}},"minute-short":{"displayName":"分","relative":{"0":"此刻"},"relativeTime":{"future":{"other":"{0}分钟后"},"past":{"other":"{0}分钟前"}}},"second":{"displayName":"秒","relative":{"0":"现在"},"relativeTime":{"future":{"other":"{0}秒钟后"},"past":{"other":"{0}秒钟前"}}},"second-short":{"displayName":"秒","relative":{"0":"现在"},"relativeTime":{"future":{"other":"{0}秒后"},"past":{"other":"{0}秒前"}}}} }); -addLocaleData({ locale: "zh-CN", parentLocale: "zh" }); +// import {shouldPolyfill} from '@formatjs/intl-pluralrules/should-polyfill' +// async function polyfill(locale) { +// const unsupportedLocale = shouldPolyfill(locale) +// // This locale is supported +// if (!unsupportedLocale) { +// return +// } +// // Load the polyfill 1st BEFORE loading data +// await import('@formatjs/intl-pluralrules/polyfill-force') +// await import(`@formatjs/intl-pluralrules/locale-data/${unsupportedLocale}`) +// } diff --git a/src/plugins/home/server/tutorials/instructions/cloud_instructions.ts b/src/plugins/home/server/tutorials/instructions/cloud_instructions.ts index 3562e4fb8b8ce..abdb56f5c3c63 100644 --- a/src/plugins/home/server/tutorials/instructions/cloud_instructions.ts +++ b/src/plugins/home/server/tutorials/instructions/cloud_instructions.ts @@ -13,9 +13,9 @@ export const cloudPasswordAndResetLink = i18n.translate( { defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.' + - `\\{#config.cloud.profileUrl\\} - Forgot the password? [Reset in Elastic Cloud](\\{config.cloud.baseUrl\\}\\{config.cloud.deploymentUrl\\}/security). - \\{/config.cloud.profileUrl\\}` + + `'{#config.cloud.profileUrl}' + Forgot the password? [Reset in Elastic Cloud]('{config.cloud.baseUrl}{config.cloud.deploymentUrl}'/security). + '{/config.cloud.profileUrl}'` + '\n\n\ > **_Important:_** Do not use the built-in `elastic` user to secure clients in a production environment. Instead set up \ authorized users or API keys, and do not expose passwords in configuration files.', diff --git a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx index 794c793b39673..b01efdb8cf44b 100644 --- a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx +++ b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx @@ -7,7 +7,7 @@ */ import React, { PureComponent, ChangeEvent } from 'react'; -import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n-react'; +import { injectI18n, FormattedMessage, WrappedComponentProps } from '@kbn/i18n-react'; import { EuiAccordion, @@ -49,7 +49,7 @@ interface ControlEditorUiProps { deps: InputControlVisDependencies; } -class ControlEditorUi extends PureComponent { +class ControlEditorUi extends PureComponent { changeLabel = (event: ChangeEvent) => { this.props.handleLabelChange(this.props.controlIndex, event.target.value); }; diff --git a/src/plugins/input_control_vis/public/components/editor/field_select.tsx b/src/plugins/input_control_vis/public/components/editor/field_select.tsx index 841622c880757..54afb424a205c 100644 --- a/src/plugins/input_control_vis/public/components/editor/field_select.tsx +++ b/src/plugins/input_control_vis/public/components/editor/field_select.tsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import React, { Component } from 'react'; -import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n-react'; +import { injectI18n, FormattedMessage, WrappedComponentProps } from '@kbn/i18n-react'; import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { DataView, DataViewField } from '@kbn/data-views-plugin/public'; @@ -20,7 +20,7 @@ interface FieldSelectUiState { indexPatternId: string; } -export type FieldSelectUiProps = InjectedIntlProps & { +export type FieldSelectUiProps = WrappedComponentProps & { getIndexPattern: (indexPatternId: string) => Promise; indexPatternId: string; onChange: (value: any) => void; diff --git a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx index 633b34902ff97..e5ca53b6aec6c 100644 --- a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx +++ b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx @@ -7,11 +7,11 @@ */ import React, { ComponentType } from 'react'; -import { injectI18n, InjectedIntlProps } from '@kbn/i18n-react'; +import { injectI18n, WrappedComponentProps } from '@kbn/i18n-react'; import { EuiFormRow } from '@elastic/eui'; import { IndexPatternSelectProps } from '@kbn/unified-search-plugin/public'; -export type IndexPatternSelectFormRowUiProps = InjectedIntlProps & { +export type IndexPatternSelectFormRowUiProps = WrappedComponentProps & { onChange: (opt: any) => void; indexPatternId: string; controlIndex: number; diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.tsx index 729f095392744..19bc3331336cb 100644 --- a/src/plugins/input_control_vis/public/components/vis/list_control.tsx +++ b/src/plugins/input_control_vis/public/components/vis/list_control.tsx @@ -9,7 +9,7 @@ import React, { PureComponent } from 'react'; import _ from 'lodash'; -import { injectI18n, InjectedIntlProps } from '@kbn/i18n-react'; +import { injectI18n, WrappedComponentProps } from '@kbn/i18n-react'; import { EuiFieldText, EuiComboBox, EuiThemeProvider } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormRow } from './form_row'; @@ -18,7 +18,7 @@ interface ListControlUiState { isLoading: boolean; } -export type ListControlUiProps = InjectedIntlProps & { +export type ListControlUiProps = WrappedComponentProps & { id: string; label: string; selectedOptions: any[]; diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx index d61d736eb7886..fe8ae34dd338e 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx @@ -18,7 +18,7 @@ import { EuiImage, EuiLink, } from '@elastic/eui'; -import { FormattedHTMLMessage, FormattedMessage } from '@kbn/i18n-react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { VULN_MGMT_POLICY_TEMPLATE } from '../../common/constants'; @@ -72,8 +72,7 @@ const CnvmIntegrationNotInstalledEmptyPrompt = ({ icon={} title={

- diff --git a/x-pack/plugins/enterprise_search/public/applications/applications/components/search_application/docs_explorer/search_ui_components.tsx b/x-pack/plugins/enterprise_search/public/applications/applications/components/search_application/docs_explorer/search_ui_components.tsx index 00cf81bd0715a..f9a0c14389bf1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/applications/components/search_application/docs_explorer/search_ui_components.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/applications/components/search_application/docs_explorer/search_ui_components.tsx @@ -35,7 +35,7 @@ import type { } from '@elastic/react-search-ui-views'; import type { SearchContextState } from '@elastic/search-ui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedHTMLMessage } from '@kbn/i18n-react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { indexHealthToHealthColor } from '../../../../shared/constants/health_colors'; @@ -163,12 +163,13 @@ export const SearchBar: React.FC = ({ additionalInputProps }) => ( ); export const PagingInfoView: React.FC = ({ start, end, totalResults }) => ( - +

+ +

); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx index 4320fff515b4e..b729c67475150 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx @@ -19,7 +19,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedHTMLMessage } from '@kbn/i18n-react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { docLinks } from '../../../../../../shared/doc_links'; @@ -71,11 +71,12 @@ export const DeployModel = ({ - +

+ +

diff --git a/x-pack/plugins/observability_solution/apm/common/tutorial/instructions/apm_agent_instructions.ts b/x-pack/plugins/observability_solution/apm/common/tutorial/instructions/apm_agent_instructions.ts index 56f8a179fb302..29f5ff468cf87 100644 --- a/x-pack/plugins/observability_solution/apm/common/tutorial/instructions/apm_agent_instructions.ts +++ b/x-pack/plugins/observability_solution/apm/common/tutorial/instructions/apm_agent_instructions.ts @@ -302,7 +302,7 @@ See the [integration documentation]({docLink}) for more information.', textPre: i18n.translate('xpack.apm.tutorial.jsClient.scriptTags.textPre', { defaultMessage: "Alternatively, you can use Script tags to set up and configure the Agent. \ -Add a `