diff --git a/x-pack/plugins/monitoring/common/constants.js b/x-pack/plugins/monitoring/common/constants.js index 7bc8164130ad..852afe74c461 100644 --- a/x-pack/plugins/monitoring/common/constants.js +++ b/x-pack/plugins/monitoring/common/constants.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { i18n } from '@kbn/i18n'; + /** * Helper string to add as a tag in every logging call */ @@ -129,10 +131,12 @@ export const LOGSTASH = { } }; -export const DEFAULT_NO_DATA_MESSAGE = 'There are no records that match your query. Try changing the time range selection.'; -export const DEFAULT_NO_DATA_MESSAGE_WITH_FILTER = ( - 'There are no records that match your query with the filter [{{FILTER}}]. Try changing the filter or the time range selection.' -); +export const DEFAULT_NO_DATA_MESSAGE = i18n.translate('xpack.monitoring.defaultNoDataMessage', { + defaultMessage: 'There are no records that match your query. Try changing the time range selection.' }); +export const DEFAULT_NO_DATA_MESSAGE_WITH_FILTER = i18n.translate('xpack.monitoring.defaultNoDataWithFilterMessage', { + defaultMessage: + 'There are no records that match your query with the filter [{filter}]. Try changing the filter or the time range selection.', + values: { filter: '{{FILTER}}' } }); export const TABLE_ACTION_UPDATE_FILTER = 'UPDATE_FILTER'; export const TABLE_ACTION_RESET_PAGING = 'RESET_PAGING'; diff --git a/x-pack/plugins/monitoring/public/lib/ajax_error_handler.js b/x-pack/plugins/monitoring/public/lib/ajax_error_handler.js index 552dc49e6332..8bad9b922158 100644 --- a/x-pack/plugins/monitoring/public/lib/ajax_error_handler.js +++ b/x-pack/plugins/monitoring/public/lib/ajax_error_handler.js @@ -13,6 +13,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export function formatMonitoringError(err) { // TODO: We should stop using Boom for errors and instead write a custom handler to return richer error objects @@ -24,7 +25,11 @@ export function formatMonitoringError(err) { { err.data.message }