From efa43e2a54e2b268609fff502a2d69e74f9f9103 Mon Sep 17 00:00:00 2001 From: Fabien Baligand Date: Mon, 10 Aug 2020 19:24:28 +0200 Subject: [PATCH] [visualizations] Add i18n translation for 'No results found' (#74619) --- 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..b047d0900cd48 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('visTypeVislib.vislib.errors.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', + })} +