Skip to content

Commit

Permalink
Replace simple error message string with i18n translation
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Sep 17, 2020
1 parent 91e9e5d commit 3524b27
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import _ from 'lodash';
import { i18n } from '@kbn/i18n';

import { TimeseriesVisualization } from './vis_types/timeseries/vis';
import { metric } from './vis_types/metric/vis';
Expand All @@ -45,7 +46,10 @@ export function Visualization(props) {
const error = _.get(visData, `${model.id}.error`);
if (_.get(error, 'error.type') === 'index_not_found_exception') {
const index = _.get(error, 'error.index');
error.message = `Index "${index}" is missing`;
error.message = i18n.translate('visTypeTimeseries.error.missingIndexErrorMessage', {
defaultMessage: 'Index "{index}" is missing',
values: { index },
});
}
if (error) {
return (
Expand Down

0 comments on commit 3524b27

Please sign in to comment.