Skip to content

Commit

Permalink
[visualizations] Add i18n translation for 'No results found' (#74619) (
Browse files Browse the repository at this point in the history
…#74686)

Co-authored-by: Fabien Baligand <fbaligand@gmail.com>
  • Loading branch information
lukeelmers and fbaligand authored Aug 10, 2020
1 parent 67275f2 commit 4e40d75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/plugins/vis_type_vislib/public/vislib/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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',
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';

interface VisualizationNoResultsProps {
Expand All @@ -37,7 +38,11 @@ export class VisualizationNoResults extends React.Component<VisualizationNoResul

<EuiSpacer size="s" />

<p>No results found</p>
<p>
{i18n.translate('visualizations.noResultsFoundTitle', {
defaultMessage: 'No results found',
})}
</p>
</EuiText>
</div>
<div className="item bottom" />
Expand Down

0 comments on commit 4e40d75

Please sign in to comment.