From dfda4bacfbcc2e23378106636b962ad299873c7e Mon Sep 17 00:00:00 2001 From: fbaligand Date: Mon, 3 Aug 2020 20:00:53 +0200 Subject: [PATCH 1/2] add i18n translation for 'No results found' --- src/plugins/vis_type_vislib/public/vislib/errors.ts | 7 ++++++- .../public/components/visualization_noresults.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/plugins/vis_type_vislib/public/vislib/errors.ts b/src/plugins/vis_type_vislib/public/vislib/errors.ts index c2965e8165759..1ea214edf8782 100644 --- a/src/plugins/vis_type_vislib/public/vislib/errors.ts +++ b/src/plugins/vis_type_vislib/public/vislib/errors.ts @@ -19,6 +19,7 @@ /* eslint-disable max-classes-per-file */ +import { i18n } from '@kbn/i18n'; import { KbnError } from '../../../kibana_utils/public'; export class VislibError extends KbnError { @@ -51,6 +52,10 @@ export class PieContainsAllZeros extends VislibError { export class NoResults extends VislibError { constructor() { - super('No results found'); + super( + i18n.translate('visualizations.noResultsFoundTitle', { + defaultMessage: 'No results found', + }) + ); } } diff --git a/src/plugins/visualizations/public/components/visualization_noresults.tsx b/src/plugins/visualizations/public/components/visualization_noresults.tsx index 1b45463f1d2ef..c77ef4490a4b3 100644 --- a/src/plugins/visualizations/public/components/visualization_noresults.tsx +++ b/src/plugins/visualizations/public/components/visualization_noresults.tsx @@ -18,6 +18,7 @@ */ import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import React from 'react'; interface VisualizationNoResultsProps { @@ -37,7 +38,11 @@ export class VisualizationNoResults extends React.Component -

No results found

+

+ {i18n.translate('visualizations.noResultsFoundTitle', { + defaultMessage: 'No results found', + })} +

From bb78a061255c2e65ddea4d297764b1dbba0710cb Mon Sep 17 00:00:00 2001 From: fbaligand Date: Mon, 10 Aug 2020 08:37:20 +0200 Subject: [PATCH 2/2] fix i18n key with 'visTypeVislib' prefix --- src/plugins/vis_type_vislib/public/vislib/errors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/vis_type_vislib/public/vislib/errors.ts b/src/plugins/vis_type_vislib/public/vislib/errors.ts index 1ea214edf8782..b047d0900cd48 100644 --- a/src/plugins/vis_type_vislib/public/vislib/errors.ts +++ b/src/plugins/vis_type_vislib/public/vislib/errors.ts @@ -53,7 +53,7 @@ export class PieContainsAllZeros extends VislibError { export class NoResults extends VislibError { constructor() { super( - i18n.translate('visualizations.noResultsFoundTitle', { + i18n.translate('visTypeVislib.vislib.errors.noResultsFoundTitle', { defaultMessage: 'No results found', }) );