From ade0188f963241c6cbbf8524b72ae611bdcf49b4 Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Wed, 21 Jul 2021 12:47:15 +0300 Subject: [PATCH 1/4] update token file --- src/core/public/i18n/i18n_eui_mapping.tsx | 107 ++++++++++------------ 1 file changed, 46 insertions(+), 61 deletions(-) diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index b7fbf8f91cc4e..992f16e521c9f 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -9,14 +9,13 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiTokensObject } from '@elastic/eui'; interface EuiValues { [key: string]: any; } export const getEuiContextMapping = () => { - const euiContextMapping: EuiTokensObject = { + const euiContextMapping = { 'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', { defaultMessage: 'Loading', }), @@ -40,7 +39,7 @@ export const getEuiContextMapping = () => { page, pageCount, }: EuiValues) => - i18n.translate('core.euiBasicTable.tableDescriptionWithoutPagination', { + i18n.translate('core.euiBasicTable.tableAutoCaptionWithPagination', { defaultMessage: 'This table contains {itemCount} rows out of {totalItemCount} rows; Page {page} of {pageCount}.', values: { itemCount, totalItemCount, page, pageCount }, @@ -144,6 +143,12 @@ export const getEuiContextMapping = () => { 'ARIA label and tooltip content describing a button that expands an actions menu', } ), + 'euiCollapsibleNav.closeButtonLabel': i18n.translate( + 'core.euiCollapsibleNav.closeButtonLabel', + { + defaultMessage: 'close', + } + ), 'euiColorPicker.screenReaderAnnouncement': i18n.translate( 'core.euiColorPicker.screenReaderAnnouncement', { @@ -219,6 +224,9 @@ export const getEuiContextMapping = () => { description: 'Screen reader text to describe the composite behavior of the color stops component.', }), + 'euiColumnActions.hideColumn': i18n.translate('core.euiColumnActions.hideColumn', { + defaultMessage: 'Hide column', + }), 'euiColumnActions.sort': ({ schemaLabel }: EuiValues) => i18n.translate('core.euiColumnActions.sort', { defaultMessage: 'Sort {schemaLabel}', @@ -230,9 +238,6 @@ export const getEuiContextMapping = () => { 'euiColumnActions.moveRight': i18n.translate('core.euiColumnActions.moveRight', { defaultMessage: 'Move right', }), - 'euiColumnActions.hideColumn': i18n.translate('core.euiColumnActions.hideColumn', { - defaultMessage: 'Hide column', - }), 'euiColumnSelector.hideAll': i18n.translate('core.euiColumnSelector.hideAll', { defaultMessage: 'Hide all', }), @@ -369,12 +374,6 @@ export const getEuiContextMapping = () => { 'euiControlBar.screenReaderHeading': i18n.translate('core.euiControlBar.screenReaderHeading', { defaultMessage: 'Page level controls', }), - 'euiControlBar.customScreenReaderAnnouncement': ({ landmarkHeading }: EuiValues) => - i18n.translate('core.euiControlBar.customScreenReaderAnnouncement', { - defaultMessage: - 'There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.', - values: { landmarkHeading }, - }), 'euiControlBar.screenReaderAnnouncement': i18n.translate( 'core.euiControlBar.screenReaderAnnouncement', { @@ -382,6 +381,12 @@ export const getEuiContextMapping = () => { 'There is a new region landmark with page level controls at the end of the document.', } ), + 'euiControlBar.customScreenReaderAnnouncement': ({ landmarkHeading }: EuiValues) => + i18n.translate('core.euiControlBar.customScreenReaderAnnouncement', { + defaultMessage: + 'There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.', + values: { landmarkHeading }, + }), 'euiDataGrid.screenReaderNotice': i18n.translate('core.euiDataGrid.screenReaderNotice', { defaultMessage: 'Cell contains interactive content.', }), @@ -466,13 +471,13 @@ export const getEuiContextMapping = () => { } ), 'euiDataGridSchema.dateSortTextAsc': i18n.translate('core.euiDataGridSchema.dateSortTextAsc', { - defaultMessage: 'New-Old', + defaultMessage: 'Old-New', description: 'Ascending date label', }), 'euiDataGridSchema.dateSortTextDesc': i18n.translate( 'core.euiDataGridSchema.dateSortTextDesc', { - defaultMessage: 'Old-New', + defaultMessage: 'New-Old', description: 'Descending date label', } ), @@ -519,8 +524,8 @@ export const getEuiContextMapping = () => { }), 'euiFilterButton.filterBadge': ({ count, hasActiveFilters }: EuiValues) => i18n.translate('core.euiFilterButton.filterBadge', { - defaultMessage: '${count} ${filterCountLabel} filters', - values: { count, filterCountLabel: hasActiveFilters ? 'active' : 'available' }, + defaultMessage: '{count} {hasActiveFilters} filters', + values: { count, hasActiveFilters: hasActiveFilters ? 'active' : 'available' }, }), 'euiFlyout.closeAriaLabel': i18n.translate('core.euiFlyout.closeAriaLabel', { defaultMessage: 'Close this dialog', @@ -642,19 +647,19 @@ export const getEuiContextMapping = () => { 'euiModal.closeModal': i18n.translate('core.euiModal.closeModal', { defaultMessage: 'Closes this modal window', }), - 'euiNotificationEventMessages.accordionButtonText': ({ + 'euiNotificationEventMessages.accordionButtonText': ({ messagesLength }: EuiValues) => + i18n.translate('core.euiNotificationEventMessages.accordionButtonText', { + defaultMessage: '+ {messagesLength} more', + values: { messagesLength }, + }), + 'euiNotificationEventMessages.accordionAriaLabelButtonText': ({ messagesLength, eventName, }: EuiValues) => - i18n.translate('core.euiNotificationEventMessages.accordionButtonText', { + i18n.translate('core.euiNotificationEventMessages.accordionAriaLabelButtonText', { defaultMessage: '+ {messagesLength} messages for {eventName}', values: { messagesLength, eventName }, }), - 'euiNotificationEventMessages.accordionAriaLabelButtonText': ({ messagesLength }: EuiValues) => - i18n.translate('core.euiNotificationEventMessages.accordionAriaLabelButtonText', { - defaultMessage: '+ {messagesLength} more', - values: { messagesLength }, - }), 'euiNotificationEventMeta.contextMenuButton': ({ eventName }: EuiValues) => i18n.translate('core.euiNotificationEventMeta.contextMenuButton', { defaultMessage: 'Menu for {eventName}', @@ -682,25 +687,6 @@ export const getEuiContextMapping = () => { defaultMessage: 'Mark as unread', } ), - 'euiNotificationEventReadIcon.readAria': ({ eventName }: EuiValues) => - i18n.translate('core.euiNotificationEventReadIcon.readAria', { - defaultMessage: '{eventName} is read', - values: { eventName }, - }), - 'euiNotificationEventReadIcon.unreadAria': ({ eventName }: EuiValues) => - i18n.translate('core.euiNotificationEventReadIcon.unreadAria', { - defaultMessage: '{eventName} is unread', - values: { eventName }, - }), - 'euiNotificationEventReadIcon.read': i18n.translate('core.euiNotificationEventReadIcon.read', { - defaultMessage: 'Read', - }), - 'euiNotificationEventReadIcon.unread': i18n.translate( - 'core.euiNotificationEventReadIcon.unread', - { - defaultMessage: 'Unread', - } - ), 'euiNotificationEventMessages.accordionHideText': i18n.translate( 'core.euiNotificationEventMessages.accordionHideText', { @@ -712,13 +698,11 @@ export const getEuiContextMapping = () => { defaultMessage: 'Next page, {page}', values: { page }, }), - 'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => ( - - ), + 'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => + i18n.translate('core.euiPagination.pageOfTotalCompressed', { + defaultMessage: '{page} of {total}', + values: { page, total }, + }), 'euiPagination.previousPage': ({ page }: EuiValues) => i18n.translate('core.euiPagination.previousPage', { defaultMessage: 'Previous page, {page}', @@ -881,7 +865,7 @@ export const getEuiContextMapping = () => { description: 'Placeholder message while data is asynchronously loaded', }), 'euiSelectable.noAvailableOptions': i18n.translate('core.euiSelectable.noAvailableOptions', { - defaultMessage: "There aren't any options available", + defaultMessage: 'No options available', }), 'euiSelectable.noMatchingOptions': ({ searchValue }: EuiValues) => ( { 'euiSelectableListItem.excludedOptionInstructions': i18n.translate( 'core.euiSelectableListItem.excludedOptionInstructions', { - defaultMessage: 'To deselect this option, press enter', + defaultMessage: 'To deselect this option, press enter.', } ), 'euiSelectableTemplateSitewide.loadingResults': i18n.translate( @@ -1039,7 +1023,7 @@ export const getEuiContextMapping = () => { 'euiSuperSelect.screenReaderAnnouncement': ({ optionsCount }: EuiValues) => i18n.translate('core.euiSuperSelect.screenReaderAnnouncement', { defaultMessage: - 'You are in a form selector of {optionsCount} items and must select a single option. Use the Up and Down keys to navigate or Escape to close.', + 'You are in a form selector of {optionsCount} items and must select a single option. Use the up and down keys to navigate or escape to close.', values: { optionsCount }, }), 'euiSuperSelectControl.selectAnOption': ({ selectedValue }: EuiValues) => @@ -1086,6 +1070,7 @@ export const getEuiContextMapping = () => { i18n.translate('core.euiTableHeaderCell.titleTextWithDesc', { defaultMessage: '{innerText}; {description}', values: { innerText, description }, + description: 'Displayed in a cell in the header of the table to describe the field', }), 'euiTablePagination.rowsPerPage': i18n.translate('core.euiTablePagination.rowsPerPage', { defaultMessage: 'Rows per page', @@ -1111,6 +1096,15 @@ export const getEuiContextMapping = () => { defaultMessage: 'Notification', description: 'ARIA label on an element containing a notification', }), + 'euiTourStep.endTour': i18n.translate('core.euiTourStep.endTour', { + defaultMessage: 'End tour', + }), + 'euiTourStep.skipTour': i18n.translate('core.euiTourStep.skipTour', { + defaultMessage: 'Skip tour', + }), + 'euiTourStep.closeTour': i18n.translate('core.euiTourStep.closeTour', { + defaultMessage: 'Close tour', + }), 'euiTourStepIndicator.isActive': i18n.translate('core.euiTourStepIndicator.isActive', { defaultMessage: 'active', description: 'Text for an active tour step', @@ -1123,15 +1117,6 @@ export const getEuiContextMapping = () => { defaultMessage: 'incomplete', description: 'Text for an incomplete tour step', }), - 'euiTourStep.endTour': i18n.translate('core.euiTourStep.endTour', { - defaultMessage: 'End tour', - }), - 'euiTourStep.skipTour': i18n.translate('core.euiTourStep.skipTour', { - defaultMessage: 'Skip tour', - }), - 'euiTourStep.closeTour': i18n.translate('core.euiTourStep.closeTour', { - defaultMessage: 'Close tour', - }), 'euiTourStepIndicator.ariaLabel': ({ status, number }: EuiValues) => i18n.translate('core.euiTourStepIndicator.ariaLabel', { defaultMessage: 'Step {number} {status}', From 68c377884b87c3e2c0cee1cd749b4c764aa221ff Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Wed, 21 Jul 2021 15:55:58 +0300 Subject: [PATCH 2/4] update tests --- .../__snapshots__/i18n_service.test.tsx.snap | 8 +- src/core/public/i18n/i18n_eui_mapping.test.ts | 100 ++++++++++++++++++ src/core/public/i18n/i18n_eui_mapping.tsx | 29 +++-- .../translations/translations/ja-JP.json | 16 ++- .../translations/translations/zh-CN.json | 16 ++- 5 files changed, 136 insertions(+), 33 deletions(-) create mode 100644 src/core/public/i18n/i18n_eui_mapping.test.ts diff --git a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap index 16504cf97366e..95f5d1953b761 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -93,8 +93,8 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiDataGridSchema.booleanSortTextDesc": "True-False", "euiDataGridSchema.currencySortTextAsc": "Low-High", "euiDataGridSchema.currencySortTextDesc": "High-Low", - "euiDataGridSchema.dateSortTextAsc": "New-Old", - "euiDataGridSchema.dateSortTextDesc": "Old-New", + "euiDataGridSchema.dateSortTextAsc": "Old-New", + "euiDataGridSchema.dateSortTextDesc": "New-Old", "euiDataGridSchema.jsonSortTextAsc": "Small-Large", "euiDataGridSchema.jsonSortTextDesc": "Large-Small", "euiDataGridSchema.numberSortTextAsc": "Low-High", @@ -180,11 +180,11 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiSaturation.roleDescription": "HSV color mode saturation and value selection", "euiSaturation.screenReaderAnnouncement": "Use the arrow keys to navigate the square color gradient. The coordinates resulting from each key press will be used to calculate HSV color mode \\"saturation\\" and \\"value\\" numbers, in the range of 0 to 1. Left and right decrease and increase (respectively) the \\"saturation\\" value. Up and down decrease and increase (respectively) the \\"value\\" value.", "euiSelectable.loadingOptions": "Loading options", - "euiSelectable.noAvailableOptions": "There aren't any options available", + "euiSelectable.noAvailableOptions": "No options available", "euiSelectable.noMatchingOptions": [Function], "euiSelectable.placeholderName": "Filter options", "euiSelectableListItem.excludedOption": "Excluded option.", - "euiSelectableListItem.excludedOptionInstructions": "To deselect this option, press enter", + "euiSelectableListItem.excludedOptionInstructions": "To deselect this option, press enter.", "euiSelectableListItem.includedOption": "Included option.", "euiSelectableListItem.includedOptionInstructions": "To exclude this option, press enter.", "euiSelectableTemplateSitewide.loadingResults": "Loading results", diff --git a/src/core/public/i18n/i18n_eui_mapping.test.ts b/src/core/public/i18n/i18n_eui_mapping.test.ts new file mode 100644 index 0000000000000..1b80257266d4c --- /dev/null +++ b/src/core/public/i18n/i18n_eui_mapping.test.ts @@ -0,0 +1,100 @@ +/* + * 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. + */ + +jest.mock('@kbn/i18n'); + +import { i18n } from '@kbn/i18n'; + +import i18ntokens from '@elastic/eui/i18ntokens.json'; +import { getEuiContextMapping } from './i18n_eui_mapping'; + +/** Regexp to find {values} usage */ +const VALUES_REGEXP = /\{\w+\}/; + +describe('@elastic/eui i18n tokens', () => { + const i18nTranslateMock = jest + .fn() + .mockImplementation((id, { defaultMessage }) => defaultMessage); + i18n.translate = i18nTranslateMock; + + const euiContextMapping = getEuiContextMapping(); + + test('all tokens are mapped', () => { + // Extract the tokens from the EUI library: We need to uniq them because they might be duplicated + const euiTokensFromLib = [...new Set(i18ntokens.map(({ token }) => token))]; + const euiTokensFromMapping = Object.keys(euiContextMapping); + + expect(euiTokensFromMapping.sort()).toStrictEqual(euiTokensFromLib.sort()); + }); + + test('tokens that include {word} should be mapped to functions', () => { + const euiTokensFromLibWithValues = i18ntokens.filter(({ defString }) => + VALUES_REGEXP.test(defString) + ); + const euiTokensFromLib = [...new Set(euiTokensFromLibWithValues.map(({ token }) => token))]; + const euiTokensFromMapping = Object.entries(euiContextMapping) + .filter(([, value]) => typeof value === 'function') + .map(([key]) => key); + + expect(euiTokensFromMapping.sort()).toStrictEqual(euiTokensFromLib.sort()); + }); + + i18ntokens.forEach(({ token, defString }) => { + describe(`Token "${token}"`, () => { + let i18nTranslateCall: [ + string, + { defaultMessage: string; values?: object; description?: string } + ]; + + beforeAll(() => { + // If it's a function, call it, so we have the mock to register the call. + const entry = euiContextMapping[token as keyof typeof euiContextMapping]; + const translationOutput = typeof entry === 'function' ? entry({}) : entry; + + // If it's a string, it comes from i18n.translate call + if (typeof translationOutput === 'string') { + // find the call in the mocks + i18nTranslateCall = i18nTranslateMock.mock.calls.find( + ([kbnToken]) => kbnToken === `core.${token}` + ); + } else { + // Otherwise, it's a fn returning `FormattedMessage` component => read the props + const { id, defaultMessage, values } = translationOutput.props; + i18nTranslateCall = [id, { defaultMessage, values }]; + } + }); + + test('a translation should be registered as `core.{TOKEN}`', () => { + expect(i18nTranslateCall).not.toBeUndefined(); + }); + + test('defaultMessage is in sync with defString', () => { + // Clean up typical errors from the `@elastic/eui` extraction token tool + const normalizedDefString = defString + // Quoted words should use double-quotes + .replace(/\s'/g, ' "') + .replace(/'\s/g, '" ') + // Should not include break-lines + .replace(/\n/g, '') + // Should trim extra spaces + .replace(/\s{2,}/g, ' ') + .trim(); + + expect(i18nTranslateCall[1].defaultMessage).toBe(normalizedDefString); + }); + + test('values should match', () => { + const valuesFromEuiLib = defString.match(new RegExp(VALUES_REGEXP, 'g')) || []; + const receivedValuesInMock = Object.keys(i18nTranslateCall[1].values ?? {}).map( + (key) => `{${key}}` + ); + expect(receivedValuesInMock.sort()).toStrictEqual(valuesFromEuiLib.sort()); + }); + }); + }); +}); diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 992f16e521c9f..d3cc2a4d4e405 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -15,7 +15,7 @@ interface EuiValues { } export const getEuiContextMapping = () => { - const euiContextMapping = { + return { 'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', { defaultMessage: 'Loading', }), @@ -143,12 +143,6 @@ export const getEuiContextMapping = () => { 'ARIA label and tooltip content describing a button that expands an actions menu', } ), - 'euiCollapsibleNav.closeButtonLabel': i18n.translate( - 'core.euiCollapsibleNav.closeButtonLabel', - { - defaultMessage: 'close', - } - ), 'euiColorPicker.screenReaderAnnouncement': i18n.translate( 'core.euiColorPicker.screenReaderAnnouncement', { @@ -1134,7 +1128,24 @@ export const getEuiContextMapping = () => { defaultMessage: 'You can quickly navigate this list using arrow keys.', } ), + 'euiNotificationEventReadIcon.read': i18n.translate('core.euiNotificationEventReadIcon.read', { + defaultMessage: 'Read', + }), + 'euiNotificationEventReadIcon.readAria': ({ eventName }: EuiValues) => + i18n.translate('core.euiNotificationEventReadIcon.readAria', { + defaultMessage: '{eventName} is read', + values: { eventName }, + }), + 'euiNotificationEventReadIcon.unread': i18n.translate( + 'core.euiNotificationEventReadIcon.unread', + { + defaultMessage: 'Unread', + } + ), + 'euiNotificationEventReadIcon.unreadAria': ({ eventName }: EuiValues) => + i18n.translate('core.euiNotificationEventReadIcon.unreadAria', { + defaultMessage: '{eventName} is unread', + values: { eventName }, + }), }; - - return euiContextMapping; }; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index ad3a58e0e9584..e0cbfd1c3e3bd 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -244,7 +244,6 @@ "core.euiBasicTable.selectThisRow": "この行を選択", "core.euiBasicTable.tableAutoCaptionWithoutPagination": "この表には{itemCount}行あります。", "core.euiBasicTable.tableCaptionWithPagination": "{tableCaption}; {page}/{pageCount}ページ。", - "core.euiBasicTable.tableDescriptionWithoutPagination": "この表には{totalItemCount}行中{itemCount}行あります; {page}/{pageCount}ページ。", "core.euiBasicTable.tablePagination": "前の表のページネーション: {tableCaption}", "core.euiBasicTable.tableSimpleAutoCaptionWithPagination": "この表には{itemCount}行あります; {page}/{pageCount}ページ。", "core.euiBottomBar.customScreenReaderAnnouncement": "ドキュメントの最後には、新しいリージョンランドマーク{landmarkHeading}とページレベルのコントロールがあります。", @@ -332,7 +331,6 @@ "core.euiFieldPassword.showPassword": "パスワードをプレーンテキストとして表示します。注記:こうすると、パスワードが誰にでも見える形で画面に表示されます。", "core.euiFilePicker.clearSelectedFiles": "選択したファイルを消去", "core.euiFilePicker.filesSelected": "選択されたファイル", - "core.euiFilterButton.filterBadge": "${count} ${filterCountLabel} 個のフィルター", "core.euiFlyout.closeAriaLabel": "このダイアログを閉じる", "core.euiForm.addressFormErrors": "ハイライトされたエラーを修正してください。", "core.euiFormControlLayoutClearButton.label": "インプットを消去", @@ -357,8 +355,6 @@ "core.euiMarkdownEditorToolbar.editor": "エディター", "core.euiMarkdownEditorToolbar.previewMarkdown": "プレビュー", "core.euiModal.closeModal": "このモーダルウィンドウを閉じます", - "core.euiNotificationEventMessages.accordionAriaLabelButtonText": "+ {messagesLength}以上", - "core.euiNotificationEventMessages.accordionButtonText": "+ {eventName}の{messagesLength}メッセージ", "core.euiNotificationEventMessages.accordionHideText": "非表示", "core.euiNotificationEventMeta.contextMenuButton": "{eventName}のメニュー", "core.euiNotificationEventReadButton.markAsRead": "既読に設定", @@ -6081,8 +6077,6 @@ "xpack.canvas.error.useImportWorkpad.missingPropertiesErrorMessage": "{CANVAS} ワークパッドに必要なプロパティの一部が欠けています。 {JSON} ファイルを編集して正しいプロパティ値を入力し、再試行してください。", "xpack.canvas.error.workpadRoutes.createFailureErrorMessage": "ワークパッドを作成できませんでした", "xpack.canvas.error.workpadRoutes.loadFailureErrorMessage": "ID でワークパッドを読み込めませんでした", - "expressionError.errorComponent.description": "表現が失敗し次のメッセージが返されました:", - "expressionError.errorComponent.title": "おっと!表現が失敗しました", "xpack.canvas.expression.cancelButtonLabel": "キャンセル", "xpack.canvas.expression.closeButtonLabel": "閉じる", "xpack.canvas.expression.learnLinkText": "表現構文の詳細", @@ -6494,15 +6488,11 @@ "xpack.canvas.renderer.advancedFilter.displayName": "高度なフィルター", "xpack.canvas.renderer.advancedFilter.helpDescription": "Canvas フィルター表現をレンダリングします。", "xpack.canvas.renderer.advancedFilter.inputPlaceholder": "フィルター表現を入力", - "expressionError.renderer.debug.displayName": "デバッグ", - "expressionError.renderer.debug.helpDescription": "デバッグアウトプットをフォーマットされた {JSON} としてレンダリングします", "xpack.canvas.renderer.dropdownFilter.displayName": "ドロップダウンフィルター", "xpack.canvas.renderer.dropdownFilter.helpDescription": "「{exactly}」フィルターの値を選択できるドロップダウンです", "xpack.canvas.renderer.dropdownFilter.matchAllOptionLabel": "すべて", "xpack.canvas.renderer.embeddable.displayName": "埋め込み可能", "xpack.canvas.renderer.embeddable.helpDescription": "Kibana の他の部分から埋め込み可能な保存済みオブジェクトをレンダリングします", - "expressionError.renderer.error.displayName": "エラー情報", - "expressionError.renderer.error.helpDescription": "エラーデータをユーザーにわかるようにレンダリングします", "xpack.canvas.renderer.image.displayName": "画像", "xpack.canvas.renderer.image.helpDescription": "画像をレンダリングします", "xpack.canvas.renderer.markdown.displayName": "マークダウン", @@ -6986,6 +6976,12 @@ "xpack.canvas.workpadTemplates.table.descriptionColumnTitle": "説明", "xpack.canvas.workpadTemplates.table.nameColumnTitle": "テンプレート名", "xpack.canvas.workpadTemplates.table.tagsColumnTitle": "タグ", + "expressionError.errorComponent.description": "表現が失敗し次のメッセージが返されました:", + "expressionError.errorComponent.title": "おっと!表現が失敗しました", + "expressionError.renderer.debug.displayName": "デバッグ", + "expressionError.renderer.debug.helpDescription": "デバッグアウトプットをフォーマットされた {JSON} としてレンダリングします", + "expressionError.renderer.error.displayName": "エラー情報", + "expressionError.renderer.error.helpDescription": "エラーデータをユーザーにわかるようにレンダリングします", "expressionRevealImage.functions.revealImage.args.emptyImageHelpText": "表示される背景画像です。画像アセットは「{BASE64}」データ {URL} として提供するか、部分式で渡します。", "expressionRevealImage.functions.revealImage.args.imageHelpText": "表示する画像です。画像アセットは{BASE64}データ{URL}として提供するか、部分式で渡します。", "expressionRevealImage.functions.revealImage.args.originHelpText": "画像で埋め始める位置です。たとえば、{list}、または {end}です。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index f7b8e216f3a4f..0cc6fd2867b8e 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -247,7 +247,6 @@ "core.euiBasicTable.selectThisRow": "选择此行", "core.euiBasicTable.tableAutoCaptionWithoutPagination": "此表包含 {itemCount} 行。", "core.euiBasicTable.tableCaptionWithPagination": "{tableCaption};第 {page} 页,共 {pageCount} 页。", - "core.euiBasicTable.tableDescriptionWithoutPagination": "此表包含 {itemCount} 行,共有 {totalItemCount} 行;第 {page} 页,共 {pageCount} 页。", "core.euiBasicTable.tablePagination": "前表分页:{tableCaption}", "core.euiBasicTable.tableSimpleAutoCaptionWithPagination": "此表包含 {itemCount} 行;第 {page} 页,共 {pageCount} 页。", "core.euiBottomBar.customScreenReaderAnnouncement": "有称作 {landmarkHeading} 且页面级别控件位于文档结尾的新地区地标。", @@ -335,7 +334,6 @@ "core.euiFieldPassword.showPassword": "将密码显示为纯文本。注意:这会将您的密码暴露在屏幕上。", "core.euiFilePicker.clearSelectedFiles": "清除选定的文件", "core.euiFilePicker.filesSelected": "个文件已选择", - "core.euiFilterButton.filterBadge": "{count} 个 {filterCountLabel} 筛选", "core.euiFlyout.closeAriaLabel": "关闭此对话框", "core.euiForm.addressFormErrors": "请解决突出显示的错误。", "core.euiFormControlLayoutClearButton.label": "清除输入", @@ -360,8 +358,6 @@ "core.euiMarkdownEditorToolbar.editor": "编辑器", "core.euiMarkdownEditorToolbar.previewMarkdown": "预览", "core.euiModal.closeModal": "关闭此模式窗口", - "core.euiNotificationEventMessages.accordionAriaLabelButtonText": "+ 另外 {messagesLength} 条", - "core.euiNotificationEventMessages.accordionButtonText": "+ {eventName} 的 {messagesLength} 条消息", "core.euiNotificationEventMessages.accordionHideText": "隐藏", "core.euiNotificationEventMeta.contextMenuButton": "{eventName} 的菜单", "core.euiNotificationEventReadButton.markAsRead": "标记为已读", @@ -6120,8 +6116,6 @@ "xpack.canvas.error.useImportWorkpad.missingPropertiesErrorMessage": "{CANVAS} Workpad 所需的某些属性缺失。 编辑 {JSON} 文件以提供正确的属性值,然后重试。", "xpack.canvas.error.workpadRoutes.createFailureErrorMessage": "无法创建 Workpad", "xpack.canvas.error.workpadRoutes.loadFailureErrorMessage": "无法加载具有以下 ID 的 Workpad", - "expressionError.errorComponent.description": "表达式失败,并显示消息:", - "expressionError.errorComponent.title": "哎哟!表达式失败", "xpack.canvas.expression.cancelButtonLabel": "取消", "xpack.canvas.expression.closeButtonLabel": "关闭", "xpack.canvas.expression.learnLinkText": "学习表达式语法", @@ -6534,15 +6528,11 @@ "xpack.canvas.renderer.advancedFilter.displayName": "高级筛选", "xpack.canvas.renderer.advancedFilter.helpDescription": "呈现 Canvas 筛选表达式", "xpack.canvas.renderer.advancedFilter.inputPlaceholder": "输入筛选表达式", - "expressionError.renderer.debug.displayName": "故障排查", - "expressionError.renderer.debug.helpDescription": "将故障排查输出呈现为带格式的 {JSON}", "xpack.canvas.renderer.dropdownFilter.displayName": "下拉列表筛选", "xpack.canvas.renderer.dropdownFilter.helpDescription": "可以从其中为“{exactly}”筛选选择值的下拉列表", "xpack.canvas.renderer.dropdownFilter.matchAllOptionLabel": "任意", "xpack.canvas.renderer.embeddable.displayName": "可嵌入", "xpack.canvas.renderer.embeddable.helpDescription": "从 Kibana 的其他部分呈现可嵌入的已保存对象", - "expressionError.renderer.error.displayName": "错误信息", - "expressionError.renderer.error.helpDescription": "以用户友好的方式呈现错误数据", "xpack.canvas.renderer.image.displayName": "图像", "xpack.canvas.renderer.image.helpDescription": "呈现图像", "xpack.canvas.renderer.markdown.displayName": "Markdown", @@ -7034,6 +7024,12 @@ "xpack.canvas.workpadTemplates.table.descriptionColumnTitle": "描述", "xpack.canvas.workpadTemplates.table.nameColumnTitle": "模板名称", "xpack.canvas.workpadTemplates.table.tagsColumnTitle": "标签", + "expressionError.errorComponent.description": "表达式失败,并显示消息:", + "expressionError.errorComponent.title": "哎哟!表达式失败", + "expressionError.renderer.debug.displayName": "故障排查", + "expressionError.renderer.debug.helpDescription": "将故障排查输出呈现为带格式的 {JSON}", + "expressionError.renderer.error.displayName": "错误信息", + "expressionError.renderer.error.helpDescription": "以用户友好的方式呈现错误数据", "expressionRevealImage.functions.revealImage.args.emptyImageHelpText": "要显示的可选背景图像。以 `{BASE64}` 数据 {URL} 的形式提供图像资产或传入子表达式。", "expressionRevealImage.functions.revealImage.args.imageHelpText": "要显示的图像。以 {BASE64} 数据 {URL} 的形式提供图像资产或传入子表达式。", "expressionRevealImage.functions.revealImage.args.originHelpText": "要开始图像填充的位置。例如 {list} 或 {end}。", From 8d87749b7c177a1aa206341ba63263d9bfe94bfc Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Thu, 22 Jul 2021 14:04:38 +0300 Subject: [PATCH 3/4] Update i18n_eui_mapping.tsx --- src/core/public/i18n/i18n_eui_mapping.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index d3cc2a4d4e405..982515a86bd70 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -14,7 +14,9 @@ interface EuiValues { [key: string]: any; } -export const getEuiContextMapping = () => { +type EuiTokensObject = Record string>; + +export const getEuiContextMapping = (): EuiTokensObject => { return { 'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', { defaultMessage: 'Loading', From 9d7e2140f55ba58fe9660817a17bbafc53dde5a6 Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Thu, 22 Jul 2021 14:05:14 +0300 Subject: [PATCH 4/4] Update i18n_eui_mapping.tsx --- src/core/public/i18n/i18n_eui_mapping.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 982515a86bd70..beed0deced35c 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -9,13 +9,12 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiTokensObject } from '@elastic/eui'; interface EuiValues { [key: string]: any; } -type EuiTokensObject = Record string>; - export const getEuiContextMapping = (): EuiTokensObject => { return { 'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', {