Skip to content

Commit

Permalink
Bump EUI to v35.0.0, update euiContextMapping to match latest i18n to…
Browse files Browse the repository at this point in the history
…kens
  • Loading branch information
chandlerprall committed Jul 12, 2021
1 parent 76f4956 commit 25bfa48
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.13",
"@elastic/ems-client": "7.14.0",
"@elastic/eui": "34.5.2",
"@elastic/eui": "35.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
Expand Down
104 changes: 61 additions & 43 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
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 = {
const euiContextMapping: EuiTokensObject = {
'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', {
defaultMessage: 'Loading',
}),
Expand Down Expand Up @@ -143,12 +144,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',
{
Expand Down Expand Up @@ -235,6 +230,9 @@ 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',
}),
Expand Down Expand Up @@ -368,6 +366,22 @@ export const getEuiContextMapping = () => {
'euiCommonlyUsedTimeRanges.legend': i18n.translate('core.euiCommonlyUsedTimeRanges.legend', {
defaultMessage: 'Commonly used',
}),
'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',
{
defaultMessage:
'There is a new region landmark with page level controls at the end of the document.',
}
),
'euiDataGrid.screenReaderNotice': i18n.translate('core.euiDataGrid.screenReaderNotice', {
defaultMessage: 'Cell contains interactive content.',
}),
Expand Down Expand Up @@ -500,6 +514,9 @@ export const getEuiContextMapping = () => {
'euiFilePicker.filesSelected': i18n.translate('core.euiFilePicker.filesSelected', {
defaultMessage: 'files selected',
}),
'euiFilePicker.removeSelected': i18n.translate('core.euiFilePicker.removeSelected', {
defaultMessage: 'Remove',
}),
'euiFilterButton.filterBadge': ({ count, hasActiveFilters }: EuiValues) =>
i18n.translate('core.euiFilterButton.filterBadge', {
defaultMessage: '${count} ${filterCountLabel} filters',
Expand All @@ -518,10 +535,6 @@ export const getEuiContextMapping = () => {
description: 'ARIA label on a button that removes any entry in a form field',
}
),
'euiHeaderAlert.dismiss': i18n.translate('core.euiHeaderAlert.dismiss', {
defaultMessage: 'Dismiss',
description: 'ARIA label on a button that dismisses/removes a notification',
}),
'euiHeaderLinks.appNavigation': i18n.translate('core.euiHeaderLinks.appNavigation', {
defaultMessage: 'App menu',
description: 'ARIA label on a `nav` element',
Expand Down Expand Up @@ -669,6 +682,25 @@ 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',
{
Expand All @@ -680,6 +712,11 @@ export const getEuiContextMapping = () => {
defaultMessage: 'Next page, {page}',
values: { page },
}),
'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}',
Expand Down Expand Up @@ -1043,29 +1080,10 @@ export const getEuiContextMapping = () => {
description: 'Displayed in a button that updates based on date picked',
}
),
'euiTableHeaderCell.clickForAscending': i18n.translate(
'core.euiTableHeaderCell.clickForAscending',
{
defaultMessage: 'Click to sort in ascending order',
description: 'Displayed in a button that toggles a table sorting',
}
),
'euiTableHeaderCell.clickForDescending': i18n.translate(
'core.euiTableHeaderCell.clickForDescending',
{
defaultMessage: 'Click to sort in descending order',
description: 'Displayed in a button that toggles a table sorting',
}
),
'euiTableHeaderCell.clickForUnsort': i18n.translate('core.euiTableHeaderCell.clickForUnsort', {
defaultMessage: 'Click to unsort',
description: 'Displayed in a button that toggles a table sorting',
}),
'euiTableHeaderCell.titleTextWithSort': ({ innerText, ariaSortValue }: EuiValues) =>
i18n.translate('core.euiTableHeaderCell.titleTextWithSort', {
defaultMessage: '{innerText}; Sorted in {ariaSortValue} order',
values: { innerText, ariaSortValue },
description: 'Text describing the table sort order',
'euiTableHeaderCell.titleTextWithDesc': ({ innerText, description }: EuiValues) =>
i18n.translate('core.euiTableHeaderCell.titleTextWithDesc', {
defaultMessage: '{innerText}; {description}',
values: { innerText, description },
}),
'euiTablePagination.rowsPerPage': i18n.translate('core.euiTablePagination.rowsPerPage', {
defaultMessage: 'Rows per page',
Expand All @@ -1091,15 +1109,6 @@ export const getEuiContextMapping = () => {
defaultMessage: 'Notification',
description: 'ARIA label on an element containing a notification',
}),
'euiTour.endTour': i18n.translate('core.euiTour.endTour', {
defaultMessage: 'End tour',
}),
'euiTour.skipTour': i18n.translate('core.euiTour.skipTour', {
defaultMessage: 'Skip tour',
}),
'euiTour.closeTour': i18n.translate('core.euiTour.closeTour', {
defaultMessage: 'Close tour',
}),
'euiTourStepIndicator.isActive': i18n.translate('core.euiTourStepIndicator.isActive', {
defaultMessage: 'active',
description: 'Text for an active tour step',
Expand All @@ -1112,6 +1121,15 @@ 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}',
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1466,10 +1466,10 @@
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==

"@elastic/eui@34.5.2":
version "34.5.2"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-34.5.2.tgz#6aad49945a894fb77785a48c281cd0bd5e9e87ba"
integrity sha512-+ColXEaZ8Oa8lJ/ixayiLuWlYUggoTTW0Q5sWXOolR94PlekxsdSpu5f0kVyxlz7ECdkHz3ttOu9RYM7Z6ARyA==
"@elastic/eui@35.0.0":
version "35.0.0"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-35.0.0.tgz#e270b4f4ce216b8bba7dc874464bfc76c242e8ce"
integrity sha512-btjkhFb017iY5OM60ka0w+N4TqNeEpsXfaVmvPB5AzYMCT4wLC1L4I2xBD7W2xQbk5fTpKuh9Q6fOk3hmv3iKQ==
dependencies:
"@types/chroma-js" "^2.0.0"
"@types/lodash" "^4.14.160"
Expand All @@ -1495,7 +1495,7 @@
react-is "~16.3.0"
react-virtualized-auto-sizer "^1.0.2"
react-window "^1.8.5"
refractor "^3.3.1"
refractor "^3.4.0"
rehype-raw "^5.0.0"
rehype-react "^6.0.0"
rehype-stringify "^8.0.0"
Expand Down Expand Up @@ -23872,7 +23872,7 @@ reflect.ownkeys@^0.2.0:
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=

refractor@^3.2.0, refractor@^3.3.1:
refractor@^3.2.0, refractor@^3.3.1, refractor@^3.4.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.3.1.tgz#ebbc04b427ea81dc25ad333f7f67a0b5f4f0be3a"
integrity sha512-vaN6R56kLMuBszHSWlwTpcZ8KTMG6aUCok4GrxYDT20UIOXxOc5o6oDc8tNTzSlH3m2sI+Eu9Jo2kVdDcUTWYw==
Expand Down

0 comments on commit 25bfa48

Please sign in to comment.