mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[i18n] Translate ML - util (#27971)
* Translate public -> util folder * Add translations for register_feature.js and breadcrumbs.js * Resolve issues from review comments
This commit is contained in:
parent
bb3bd2a16d
commit
3496dff912
4 changed files with 29 additions and 9 deletions
|
@ -4,8 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export const ML_BREADCRUMB = Object.freeze({
|
||||
text: 'Machine Learning',
|
||||
text: i18n.translate('xpack.ml.machineLearningBreadcrumbLabel', {
|
||||
defaultMessage: 'Machine Learning'
|
||||
}),
|
||||
href: '#/'
|
||||
});
|
||||
|
|
|
@ -8,11 +8,15 @@
|
|||
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
return {
|
||||
id: 'ml',
|
||||
title: 'Machine Learning',
|
||||
description: 'Automatically model the normal behavior of your time series data to detect anomalies.',
|
||||
title: i18n('xpack.ml.machineLearningTitle', {
|
||||
defaultMessage: 'Machine Learning'
|
||||
}),
|
||||
description: i18n('xpack.ml.machineLearningDescription', {
|
||||
defaultMessage: 'Automatically model the normal behavior of your time series data to detect anomalies.'
|
||||
}),
|
||||
icon: 'machineLearningApp',
|
||||
path: '/app/ml',
|
||||
showOnHomePage: true,
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
import { SavedObjectsClientProvider } from 'ui/saved_objects';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
let indexPatternCache = [];
|
||||
let fullIndexPatterns = [];
|
||||
|
@ -91,8 +92,13 @@ export function timeBasedIndexCheck(indexPattern, showNotification = false) {
|
|||
if (indexPattern.isTimeBased() === false) {
|
||||
if (showNotification) {
|
||||
toastNotifications.addWarning({
|
||||
title: `The index pattern ${indexPattern.title} is not based on a time series`,
|
||||
text: 'Anomaly detection only runs over time-based indices',
|
||||
title: i18n.translate('xpack.ml.indexPatternNotBasedOnTimeSeriesNotificationTitle', {
|
||||
defaultMessage: 'The index pattern {indexPatternTitle} is not based on a time series',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
}),
|
||||
text: i18n.translate('xpack.ml.indexPatternNotBasedOnTimeSeriesNotificationDescription', {
|
||||
defaultMessage: 'Anomaly detection only runs over time-based indices'
|
||||
}),
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// utility functions for managing which links get added to kibana's recently accessed list
|
||||
|
||||
import { recentlyAccessed } from 'ui/persisted_log';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export function addItemToRecentlyAccessed(page, itemId, url) {
|
||||
let pageLabel = '';
|
||||
|
@ -16,13 +17,19 @@ export function addItemToRecentlyAccessed(page, itemId, url) {
|
|||
|
||||
switch (page) {
|
||||
case 'explorer':
|
||||
pageLabel = 'Anomaly Explorer';
|
||||
pageLabel = i18n.translate('xpack.ml.anomalyExplorerPageLabel', {
|
||||
defaultMessage: 'Anomaly Explorer'
|
||||
});
|
||||
break;
|
||||
case 'timeseriesexplorer':
|
||||
pageLabel = 'Single Metric Viewer';
|
||||
pageLabel = i18n.translate('xpack.ml.singleMetricViewerPageLabel', {
|
||||
defaultMessage: 'Single Metric Viewer'
|
||||
});
|
||||
break;
|
||||
case 'jobs/new_job/datavisualizer':
|
||||
pageLabel = 'Data Visualizer';
|
||||
pageLabel = i18n.translate('xpack.ml.dataVisualizerPageLabel', {
|
||||
defaultMessage: 'Data Visualizer'
|
||||
});
|
||||
id = `ml-datavisualizer-${itemId}`;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue