mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Remove angular i18n service calls (#36329)
* Remove angular i18n service calls
This commit is contained in:
parent
5401d80eb1
commit
140978d28c
141 changed files with 926 additions and 785 deletions
|
@ -18,15 +18,16 @@
|
|||
*/
|
||||
|
||||
import { KbnTopNavControllerProvider } from 'ui/kbn_top_nav/kbn_top_nav_controller';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import storage from '../storage';
|
||||
|
||||
export function SenseTopNavController(Private, i18n) {
|
||||
export function SenseTopNavController(Private) {
|
||||
const KbnTopNavController = Private(KbnTopNavControllerProvider);
|
||||
|
||||
const controller = new KbnTopNavController([
|
||||
{
|
||||
key: 'welcome',
|
||||
label: i18n('console.topNav.welcomeTabLabel', {
|
||||
label: i18n.translate('console.topNav.welcomeTabLabel', {
|
||||
defaultMessage: 'Welcome'
|
||||
}),
|
||||
hideButton: true,
|
||||
|
@ -35,10 +36,10 @@ export function SenseTopNavController(Private, i18n) {
|
|||
},
|
||||
{
|
||||
key: 'history',
|
||||
label: i18n('console.topNav.historyTabLabel', {
|
||||
label: i18n.translate('console.topNav.historyTabLabel', {
|
||||
defaultMessage: 'History'
|
||||
}),
|
||||
description: i18n('console.topNav.historyTabDescription', {
|
||||
description: i18n.translate('console.topNav.historyTabDescription', {
|
||||
defaultMessage: 'History',
|
||||
}),
|
||||
template: `<sense-history></sense-history>`,
|
||||
|
@ -46,10 +47,10 @@ export function SenseTopNavController(Private, i18n) {
|
|||
},
|
||||
{
|
||||
key: 'settings',
|
||||
label: i18n('console.topNav.settingsTabLabel', {
|
||||
label: i18n.translate('console.topNav.settingsTabLabel', {
|
||||
defaultMessage: 'Settings'
|
||||
}),
|
||||
description: i18n('console.topNav.settingsTabDescription', {
|
||||
description: i18n.translate('console.topNav.settingsTabDescription', {
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
template: `<sense-settings></sense-settings>`,
|
||||
|
@ -57,10 +58,10 @@ export function SenseTopNavController(Private, i18n) {
|
|||
},
|
||||
{
|
||||
key: 'help',
|
||||
label: i18n('console.topNav.helpTabLabel', {
|
||||
label: i18n.translate('console.topNav.helpTabLabel', {
|
||||
defaultMessage: 'Help'
|
||||
}),
|
||||
description: i18n('console.topNav.helpTabDescription', {
|
||||
description: i18n.translate('console.topNav.helpTabDescription', {
|
||||
defaultMessage: 'Help',
|
||||
}),
|
||||
template: `<sense-help></sense-help>`,
|
||||
|
|
|
@ -19,11 +19,13 @@
|
|||
|
||||
const SenseEditor = require('../sense_editor/editor');
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { applyResizeCheckerToEditors } from '../sense_editor_resize';
|
||||
|
||||
require('ui/modules')
|
||||
.get('app/sense')
|
||||
.directive('senseHistoryViewer', function (i18n) {
|
||||
.directive('senseHistoryViewer', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
|
@ -43,7 +45,7 @@ require('ui/modules')
|
|||
viewer.clearSelection();
|
||||
} else {
|
||||
viewer.getSession().setValue(
|
||||
i18n('console.historyPage.noHistoryTextMessage', { defaultMessage: 'No history available' })
|
||||
i18n.translate('console.historyPage.noHistoryTextMessage', { defaultMessage: 'No history available' })
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,11 +19,13 @@
|
|||
|
||||
require('./sense_help_example');
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const storage = require('../storage');
|
||||
|
||||
require('ui/modules')
|
||||
.get('app/sense')
|
||||
.directive('senseWelcome', function (i18n) {
|
||||
.directive('senseWelcome', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: require('./welcome.html'),
|
||||
|
@ -31,7 +33,7 @@ require('ui/modules')
|
|||
$scope.$on('$destroy', function () {
|
||||
storage.set('version_welcome_shown', '@@SENSE_REVISION');
|
||||
});
|
||||
$scope.asWellAsFragmentText = i18n('console.welcomePage.supportedRequestFormatDescription.asWellAsFragmentText', {
|
||||
$scope.asWellAsFragmentText = i18n.translate('console.welcomePage.supportedRequestFormatDescription.asWellAsFragmentText', {
|
||||
defaultMessage: 'as well as'
|
||||
});
|
||||
},
|
||||
|
|
|
@ -18,17 +18,19 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import pointSeriesTemplate from './editors/point_series.html';
|
||||
|
||||
export default function PointSeriesVisType(Private, i18n) {
|
||||
export default function PointSeriesVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'area',
|
||||
title: i18n('kbnVislibVisTypes.area.areaTitle', { defaultMessage: 'Area' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.areaTitle', { defaultMessage: 'Area' }),
|
||||
icon: 'visArea',
|
||||
description: i18n('kbnVislibVisTypes.area.areaDescription', { defaultMessage: 'Emphasize the quantity beneath a line chart' }),
|
||||
description: i18n.translate(
|
||||
'kbnVislibVisTypes.area.areaDescription', { defaultMessage: 'Emphasize the quantity beneath a line chart' }),
|
||||
visConfig: {
|
||||
defaults: {
|
||||
type: 'area',
|
||||
|
@ -135,7 +137,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.area.metricsTitle', { defaultMessage: 'Y-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.metricsTitle', { defaultMessage: 'Y-Axis' }),
|
||||
aggFilter: ['!geo_centroid', '!geo_bounds'],
|
||||
min: 1,
|
||||
defaults: [
|
||||
|
@ -145,7 +147,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'radius',
|
||||
title: i18n('kbnVislibVisTypes.area.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
|
||||
|
@ -153,7 +155,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'segment',
|
||||
title: i18n('kbnVislibVisTypes.area.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -161,7 +163,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.area.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
min: 0,
|
||||
max: 3,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -169,7 +171,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: i18n('kbnVislibVisTypes.area.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.area.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
*/
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import gaugeOptionsTemplate from './gauge_options.html';
|
||||
import _ from 'lodash';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('gaugeOptions', function (i18n) {
|
||||
module.directive('gaugeOptions', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: gaugeOptionsTemplate,
|
||||
|
@ -107,7 +108,7 @@ module.directive('gaugeOptions', function (i18n) {
|
|||
$scope.customColors = true;
|
||||
});
|
||||
|
||||
$scope.requiredText = i18n('kbnVislibVisTypes.controls.gaugeOptions.requiredText', {
|
||||
$scope.requiredText = i18n.translate('kbnVislibVisTypes.controls.gaugeOptions.requiredText', {
|
||||
defaultMessage: 'Required:'
|
||||
});
|
||||
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
*/
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import heatmapOptionsTemplate from './heatmap_options.html';
|
||||
import _ from 'lodash';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('heatmapOptions', function (i18n) {
|
||||
module.directive('heatmapOptions', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: heatmapOptionsTemplate,
|
||||
|
@ -89,7 +90,7 @@ module.directive('heatmapOptions', function (i18n) {
|
|||
$scope.customColors = true;
|
||||
});
|
||||
|
||||
$scope.requiredText = i18n('kbnVislibVisTypes.controls.heatmapOptions.requiredText', {
|
||||
$scope.requiredText = i18n.translate('kbnVislibVisTypes.controls.heatmapOptions.requiredText', {
|
||||
defaultMessage: 'Required:'
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,18 +18,19 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import gaugeTemplate from './editors/gauge.html';
|
||||
import { vislibColorMaps } from 'ui/vislib/components/color/colormaps';
|
||||
|
||||
export default function GaugeVisType(Private, i18n) {
|
||||
export default function GaugeVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'gauge',
|
||||
title: i18n('kbnVislibVisTypes.gauge.gaugeTitle', { defaultMessage: 'Gauge' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.gauge.gaugeTitle', { defaultMessage: 'Gauge' }),
|
||||
icon: 'visGauge',
|
||||
description: i18n('kbnVislibVisTypes.gauge.gaugeDescription', {
|
||||
description: i18n.translate('kbnVislibVisTypes.gauge.gaugeDescription', {
|
||||
defaultMessage: 'Gauges indicate the status of a metric. Use it to show how a metric\'s value relates to reference threshold values.'
|
||||
}),
|
||||
visConfig: {
|
||||
|
@ -93,7 +94,7 @@ export default function GaugeVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.gauge.metricTitle', { defaultMessage: 'Metric' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.gauge.metricTitle', { defaultMessage: 'Metric' }),
|
||||
min: 1,
|
||||
aggFilter: [
|
||||
'!std_dev', '!geo_centroid', '!percentiles', '!percentile_ranks',
|
||||
|
@ -105,7 +106,7 @@ export default function GaugeVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.gauge.groupTitle', { defaultMessage: 'Split Group' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.gauge.groupTitle', { defaultMessage: 'Split Group' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,18 +18,19 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import gaugeTemplate from './editors/gauge.html';
|
||||
import { vislibColorMaps } from 'ui/vislib/components/color/colormaps';
|
||||
|
||||
export default function GoalVisType(Private, i18n) {
|
||||
export default function GoalVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'goal',
|
||||
title: i18n('kbnVislibVisTypes.goal.goalTitle', { defaultMessage: 'Goal' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.goal.goalTitle', { defaultMessage: 'Goal' }),
|
||||
icon: 'visGoal',
|
||||
description: i18n('kbnVislibVisTypes.goal.goalDescription', {
|
||||
description: i18n.translate('kbnVislibVisTypes.goal.goalDescription', {
|
||||
defaultMessage: 'A goal chart indicates how close you are to your final goal.'
|
||||
}),
|
||||
visConfig: {
|
||||
|
@ -89,7 +90,7 @@ export default function GoalVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.goal.metricTitle', { defaultMessage: 'Metric' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.goal.metricTitle', { defaultMessage: 'Metric' }),
|
||||
min: 1,
|
||||
aggFilter: [
|
||||
'!std_dev', '!geo_centroid', '!percentiles', '!percentile_ranks',
|
||||
|
@ -101,7 +102,7 @@ export default function GoalVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.goal.groupTitle', { defaultMessage: 'Split Group' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.goal.groupTitle', { defaultMessage: 'Split Group' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,18 +18,19 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import heatmapTemplate from './editors/heatmap.html';
|
||||
import { vislibColorMaps } from 'ui/vislib/components/color/colormaps';
|
||||
|
||||
export default function HeatmapVisType(Private, i18n) {
|
||||
export default function HeatmapVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'heatmap',
|
||||
title: i18n('kbnVislibVisTypes.heatmap.heatmapTitle', { defaultMessage: 'Heat Map' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.heatmap.heatmapTitle', { defaultMessage: 'Heat Map' }),
|
||||
icon: 'visHeatmap',
|
||||
description: i18n('kbnVislibVisTypes.heatmap.heatmapDescription', { defaultMessage: 'Shade cells within a matrix' }),
|
||||
description: i18n.translate('kbnVislibVisTypes.heatmap.heatmapDescription', { defaultMessage: 'Shade cells within a matrix' }),
|
||||
visConfig: {
|
||||
defaults: {
|
||||
type: 'heatmap',
|
||||
|
@ -84,7 +85,7 @@ export default function HeatmapVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.heatmap.metricTitle', { defaultMessage: 'Value' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.heatmap.metricTitle', { defaultMessage: 'Value' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'median', 'sum', 'min', 'max', 'cardinality', 'std_dev', 'top_hits'],
|
||||
|
@ -95,7 +96,7 @@ export default function HeatmapVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'segment',
|
||||
title: i18n('kbnVislibVisTypes.heatmap.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.heatmap.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -103,7 +104,7 @@ export default function HeatmapVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.heatmap.groupTitle', { defaultMessage: 'Y-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.heatmap.groupTitle', { defaultMessage: 'Y-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -111,7 +112,7 @@ export default function HeatmapVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: i18n('kbnVislibVisTypes.heatmap.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.heatmap.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import pointSeriesTemplate from './editors/point_series.html';
|
||||
|
||||
export default function PointSeriesVisType(Private, i18n) {
|
||||
export default function PointSeriesVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'histogram',
|
||||
title: i18n('kbnVislibVisTypes.histogram.histogramTitle', { defaultMessage: 'Vertical Bar' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.histogramTitle', { defaultMessage: 'Vertical Bar' }),
|
||||
icon: 'visBarVertical',
|
||||
description: i18n('kbnVislibVisTypes.histogram.histogramDescription',
|
||||
description: i18n.translate('kbnVislibVisTypes.histogram.histogramDescription',
|
||||
{ defaultMessage: 'Assign a continuous variable to each axis' }
|
||||
),
|
||||
visConfig: {
|
||||
|
@ -138,7 +139,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.histogram.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
min: 1,
|
||||
aggFilter: ['!geo_centroid', '!geo_bounds'],
|
||||
defaults: [
|
||||
|
@ -148,7 +149,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'radius',
|
||||
title: i18n('kbnVislibVisTypes.histogram.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
|
||||
|
@ -156,7 +157,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'segment',
|
||||
title: i18n('kbnVislibVisTypes.histogram.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -164,7 +165,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.histogram.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
min: 0,
|
||||
max: 3,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -172,7 +173,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: i18n('kbnVislibVisTypes.histogram.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.histogram.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import pointSeriesTemplate from './editors/point_series.html';
|
||||
|
||||
export default function PointSeriesVisType(Private, i18n) {
|
||||
export default function PointSeriesVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'horizontal_bar',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.horizontalBarTitle', { defaultMessage: 'Horizontal Bar' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.horizontalBarTitle', { defaultMessage: 'Horizontal Bar' }),
|
||||
icon: 'visBarHorizontal',
|
||||
description: i18n('kbnVislibVisTypes.horizontalBar.horizontalBarDescription',
|
||||
description: i18n.translate('kbnVislibVisTypes.horizontalBar.horizontalBarDescription',
|
||||
{ defaultMessage: 'Assign a continuous variable to each axis' }
|
||||
),
|
||||
visConfig: {
|
||||
|
@ -140,7 +141,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
min: 1,
|
||||
aggFilter: ['!geo_centroid', '!geo_bounds'],
|
||||
defaults: [
|
||||
|
@ -150,7 +151,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'radius',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
|
||||
|
@ -158,7 +159,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'segment',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -166,7 +167,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
min: 0,
|
||||
max: 3,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -174,7 +175,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: i18n('kbnVislibVisTypes.horizontalBar.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.horizontalBar.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import pointSeriesTemplate from './editors/point_series.html';
|
||||
|
||||
export default function PointSeriesVisType(Private, i18n) {
|
||||
export default function PointSeriesVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'line',
|
||||
title: i18n('kbnVislibVisTypes.line.lineTitle', { defaultMessage: 'Line' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.lineTitle', { defaultMessage: 'Line' }),
|
||||
icon: 'visLine',
|
||||
description: i18n('kbnVislibVisTypes.line.lineDescription', { defaultMessage: 'Emphasize trends' }),
|
||||
description: i18n.translate('kbnVislibVisTypes.line.lineDescription', { defaultMessage: 'Emphasize trends' }),
|
||||
visConfig: {
|
||||
defaults: {
|
||||
type: 'line',
|
||||
|
@ -136,7 +137,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.line.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.metricTitle', { defaultMessage: 'Y-Axis' }),
|
||||
min: 1,
|
||||
aggFilter: ['!geo_centroid', '!geo_bounds'],
|
||||
defaults: [
|
||||
|
@ -146,7 +147,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'radius',
|
||||
title: i18n('kbnVislibVisTypes.line.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.radiusTitle', { defaultMessage: 'Dot Size' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits']
|
||||
|
@ -154,7 +155,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'segment',
|
||||
title: i18n('kbnVislibVisTypes.line.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.segmentTitle', { defaultMessage: 'X-Axis' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -162,7 +163,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('kbnVislibVisTypes.line.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.groupTitle', { defaultMessage: 'Split Series' }),
|
||||
min: 0,
|
||||
max: 3,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -170,7 +171,7 @@ export default function PointSeriesVisType(Private, i18n) {
|
|||
{
|
||||
group: 'buckets',
|
||||
name: 'split',
|
||||
title: i18n('kbnVislibVisTypes.line.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.line.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import pieTemplate from './editors/pie.html';
|
||||
|
||||
export default function HistogramVisType(Private, i18n) {
|
||||
export default function HistogramVisType(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createVislibVisualization({
|
||||
name: 'pie',
|
||||
title: i18n('kbnVislibVisTypes.pie.pieTitle', { defaultMessage: 'Pie' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.pie.pieTitle', { defaultMessage: 'Pie' }),
|
||||
icon: 'visPie',
|
||||
description: i18n('kbnVislibVisTypes.pie.pieDescription', { defaultMessage: 'Compare parts of a whole' }),
|
||||
description: i18n.translate('kbnVislibVisTypes.pie.pieDescription', { defaultMessage: 'Compare parts of a whole' }),
|
||||
visConfig: {
|
||||
defaults: {
|
||||
type: 'pie',
|
||||
|
@ -68,7 +69,7 @@ export default function HistogramVisType(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('kbnVislibVisTypes.pie.metricTitle', { defaultMessage: 'Slice Size' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.pie.metricTitle', { defaultMessage: 'Slice Size' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['sum', 'count', 'cardinality', 'top_hits'],
|
||||
|
@ -80,7 +81,7 @@ export default function HistogramVisType(Private, i18n) {
|
|||
group: 'buckets',
|
||||
name: 'segment',
|
||||
icon: 'fa fa-scissors',
|
||||
title: i18n('kbnVislibVisTypes.pie.segmentTitle', { defaultMessage: 'Split Slices' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.pie.segmentTitle', { defaultMessage: 'Split Slices' }),
|
||||
min: 0,
|
||||
max: Infinity,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
@ -89,7 +90,7 @@ export default function HistogramVisType(Private, i18n) {
|
|||
group: 'buckets',
|
||||
name: 'split',
|
||||
icon: 'fa fa-th',
|
||||
title: i18n('kbnVislibVisTypes.pie.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
title: i18n.translate('kbnVislibVisTypes.pie.splitTitle', { defaultMessage: 'Split Chart' }),
|
||||
mustBeFirst: true,
|
||||
min: 0,
|
||||
max: 1,
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { SearchSourceProvider } from 'ui/courier';
|
||||
|
||||
export function fetchAnchorProvider(indexPatterns, Private, i18n) {
|
||||
export function fetchAnchorProvider(indexPatterns, Private) {
|
||||
const SearchSource = Private(SearchSourceProvider);
|
||||
|
||||
return async function fetchAnchor(
|
||||
|
@ -54,7 +56,7 @@ export function fetchAnchorProvider(indexPatterns, Private, i18n) {
|
|||
const response = await searchSource.fetch();
|
||||
|
||||
if (_.get(response, ['hits', 'total'], 0) < 1) {
|
||||
throw new Error(i18n('kbn.context.failedToLoadAnchorDocumentErrorDescription', {
|
||||
throw new Error(i18n.translate('kbn.context.failedToLoadAnchorDocumentErrorDescription', {
|
||||
defaultMessage: 'Failed to load anchor document.'
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import { MarkdownSimple } from 'ui/markdown';
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
|
@ -27,7 +28,7 @@ import { fetchContextProvider } from '../api/context';
|
|||
import { QueryParameterActionsProvider } from '../query_parameters';
|
||||
import { FAILURE_REASONS, LOADING_STATUS } from './constants';
|
||||
|
||||
export function QueryActionsProvider(courier, Private, Promise, i18n) {
|
||||
export function QueryActionsProvider(courier, Private, Promise) {
|
||||
const fetchAnchor = Private(fetchAnchorProvider);
|
||||
const { fetchPredecessors, fetchSuccessors } = Private(fetchContextProvider);
|
||||
const {
|
||||
|
@ -81,7 +82,7 @@ export function QueryActionsProvider(courier, Private, Promise, i18n) {
|
|||
(error) => {
|
||||
setFailedStatus(state)('anchor', { error });
|
||||
toastNotifications.addDanger({
|
||||
title: i18n('kbn.context.unableToLoadAnchorDocumentDescription', {
|
||||
title: i18n.translate('kbn.context.unableToLoadAnchorDocumentDescription', {
|
||||
defaultMessage: 'Unable to load the anchor document'
|
||||
}),
|
||||
text: <MarkdownSimple>{error.message}</MarkdownSimple>,
|
||||
|
@ -126,7 +127,7 @@ export function QueryActionsProvider(courier, Private, Promise, i18n) {
|
|||
(error) => {
|
||||
setFailedStatus(state)('predecessors', { error });
|
||||
toastNotifications.addDanger({
|
||||
title: i18n('kbn.context.unableToLoadDocumentDescription', {
|
||||
title: i18n.translate('kbn.context.unableToLoadDocumentDescription', {
|
||||
defaultMessage: 'Unable to load documents'
|
||||
}),
|
||||
text: <MarkdownSimple>{error.message}</MarkdownSimple>,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import angular from 'angular';
|
||||
import { uiModules } from 'ui/modules';
|
||||
|
@ -91,8 +92,7 @@ app.directive('dashboardApp', function ($injector) {
|
|||
$routeParams,
|
||||
getAppState,
|
||||
dashboardConfig,
|
||||
localStorage,
|
||||
i18n,
|
||||
localStorage
|
||||
) {
|
||||
const filterManager = Private(FilterManagerProvider);
|
||||
const queryFilter = Private(FilterBarQueryFilterProvider);
|
||||
|
@ -204,7 +204,7 @@ app.directive('dashboardApp', function ($injector) {
|
|||
const updateBreadcrumbs = () => {
|
||||
chrome.breadcrumbs.set([
|
||||
{
|
||||
text: i18n('kbn.dashboard.dashboardAppBreadcrumbsTitle', {
|
||||
text: i18n.translate('kbn.dashboard.dashboardAppBreadcrumbsTitle', {
|
||||
defaultMessage: 'Dashboard',
|
||||
}),
|
||||
href: $scope.landingPageUrl()
|
||||
|
@ -335,20 +335,20 @@ app.directive('dashboardApp', function ($injector) {
|
|||
}
|
||||
|
||||
confirmModal(
|
||||
i18n('kbn.dashboard.changeViewModeConfirmModal.discardChangesDescription',
|
||||
i18n.translate('kbn.dashboard.changeViewModeConfirmModal.discardChangesDescription',
|
||||
{ defaultMessage: `Once you discard your changes, there's no getting them back.` }
|
||||
),
|
||||
{
|
||||
onConfirm: revertChangesAndExitEditMode,
|
||||
onCancel: _.noop,
|
||||
confirmButtonText: i18n('kbn.dashboard.changeViewModeConfirmModal.confirmButtonLabel',
|
||||
confirmButtonText: i18n.translate('kbn.dashboard.changeViewModeConfirmModal.confirmButtonLabel',
|
||||
{ defaultMessage: 'Discard changes' }
|
||||
),
|
||||
cancelButtonText: i18n('kbn.dashboard.changeViewModeConfirmModal.cancelButtonLabel',
|
||||
cancelButtonText: i18n.translate('kbn.dashboard.changeViewModeConfirmModal.cancelButtonLabel',
|
||||
{ defaultMessage: 'Continue editing' }
|
||||
),
|
||||
defaultFocusedButton: ConfirmationButtonTypes.CANCEL,
|
||||
title: i18n('kbn.dashboard.changeViewModeConfirmModal.discardChangesTitle',
|
||||
title: i18n.translate('kbn.dashboard.changeViewModeConfirmModal.discardChangesTitle',
|
||||
{ defaultMessage: 'Discard changes to dashboard?' }
|
||||
)
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ app.directive('dashboardApp', function ($injector) {
|
|||
.then(function (id) {
|
||||
if (id) {
|
||||
toastNotifications.addSuccess({
|
||||
title: i18n('kbn.dashboard.dashboardWasSavedSuccessMessage',
|
||||
title: i18n.translate('kbn.dashboard.dashboardWasSavedSuccessMessage',
|
||||
{
|
||||
defaultMessage: `Dashboard '{dashTitle}' was saved`,
|
||||
values: { dashTitle: dash.title },
|
||||
|
@ -391,7 +391,7 @@ app.directive('dashboardApp', function ($injector) {
|
|||
return { id };
|
||||
}).catch((error) => {
|
||||
toastNotifications.addDanger({
|
||||
title: i18n('kbn.dashboard.dashboardWasNotSavedDangerMessage',
|
||||
title: i18n.translate('kbn.dashboard.dashboardWasNotSavedDangerMessage',
|
||||
{
|
||||
defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`,
|
||||
values: {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './dashboard_app';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import './saved_dashboard/saved_dashboards';
|
||||
import './dashboard_config';
|
||||
import uiRoutes from 'ui/routes';
|
||||
|
@ -48,8 +49,8 @@ app.directive('dashboardListing', function (reactDirective) {
|
|||
return reactDirective(wrapInI18nContext(DashboardListing));
|
||||
});
|
||||
|
||||
function createNewDashboardCtrl($scope, i18n) {
|
||||
$scope.visitVisualizeAppLinkText = i18n('kbn.dashboard.visitVisualizeAppLinkText', {
|
||||
function createNewDashboardCtrl($scope) {
|
||||
$scope.visitVisualizeAppLinkText = i18n.translate('kbn.dashboard.visitVisualizeAppLinkText', {
|
||||
defaultMessage: 'visit the Visualize app',
|
||||
});
|
||||
}
|
||||
|
@ -58,16 +59,16 @@ uiRoutes
|
|||
.defaults(/dashboard/, {
|
||||
requireDefaultIndex: true,
|
||||
requireUICapability: 'dashboard.show',
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.dashboard.showWriteControls) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.dashboard.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.dashboard.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.dashboard.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.dashboard.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save dashboards',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
@ -76,7 +77,7 @@ uiRoutes
|
|||
})
|
||||
.when(DashboardConstants.LANDING_PAGE_PATH, {
|
||||
template: dashboardListingTemplate,
|
||||
controller($injector, $location, $scope, Private, config, i18n) {
|
||||
controller($injector, $location, $scope, Private, config) {
|
||||
const services = Private(SavedObjectRegistryProvider).byLoaderPropertiesName;
|
||||
const kbnUrl = $injector.get('kbnUrl');
|
||||
const dashboardConfig = $injector.get('dashboardConfig');
|
||||
|
@ -100,7 +101,7 @@ uiRoutes
|
|||
$scope.hideWriteControls = dashboardConfig.getHideWriteControls();
|
||||
$scope.initialFilter = ($location.search()).filter || EMPTY_FILTER;
|
||||
chrome.breadcrumbs.set([{
|
||||
text: i18n('kbn.dashboard.dashboardBreadcrumbsTitle', {
|
||||
text: i18n.translate('kbn.dashboard.dashboardBreadcrumbsTitle', {
|
||||
defaultMessage: 'Dashboards',
|
||||
}),
|
||||
}]);
|
||||
|
@ -148,7 +149,7 @@ uiRoutes
|
|||
template: dashboardTemplate,
|
||||
controller: createNewDashboardCtrl,
|
||||
resolve: {
|
||||
dash: function (savedDashboards, $route, redirectWhenMissing, kbnUrl, AppState, i18n) {
|
||||
dash: function (savedDashboards, $route, redirectWhenMissing, kbnUrl, AppState) {
|
||||
const id = $route.current.params.id;
|
||||
|
||||
return savedDashboards.get(id)
|
||||
|
@ -169,7 +170,7 @@ uiRoutes
|
|||
if (error instanceof SavedObjectNotFound && id === 'create') {
|
||||
// Note "new AppState" is necessary so the state in the url is preserved through the redirect.
|
||||
kbnUrl.redirect(DashboardConstants.CREATE_NEW_DASHBOARD_URL, {}, new AppState());
|
||||
toastNotifications.addWarning(i18n('kbn.dashboard.urlWasRemovedInSixZeroWarningMessage',
|
||||
toastNotifications.addWarning(i18n.translate('kbn.dashboard.urlWasRemovedInSixZeroWarningMessage',
|
||||
{ defaultMessage: 'The url "dashboard/create" was removed in 6.0. Please update your bookmarks.' }
|
||||
));
|
||||
} else {
|
||||
|
@ -183,13 +184,13 @@ uiRoutes
|
|||
}
|
||||
});
|
||||
|
||||
FeatureCatalogueRegistryProvider.register((i18n) => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'dashboard',
|
||||
title: i18n('kbn.dashboard.featureCatalogue.dashboardTitle', {
|
||||
title: i18n.translate('kbn.dashboard.featureCatalogue.dashboardTitle', {
|
||||
defaultMessage: 'Dashboard',
|
||||
}),
|
||||
description: i18n('kbn.dashboard.featureCatalogue.dashboardDescription', {
|
||||
description: i18n.translate('kbn.dashboard.featureCatalogue.dashboardDescription', {
|
||||
defaultMessage: 'Display and share a collection of visualizations and saved searches.',
|
||||
}),
|
||||
icon: 'dashboardApp',
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import angular from 'angular';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { createDashboardEditUrl } from '../dashboard_constants';
|
||||
import { createLegacyClass } from 'ui/utils/legacy_class';
|
||||
|
@ -30,7 +31,7 @@ import {
|
|||
const module = uiModules.get('app/dashboard');
|
||||
|
||||
// Used only by the savedDashboards service, usually no reason to change this
|
||||
module.factory('SavedDashboard', function (Private, config, i18n) {
|
||||
module.factory('SavedDashboard', function (Private) {
|
||||
// SavedDashboard constructor. Usually you'd interact with an instance of this.
|
||||
// ID is option, without it one will be generated on save.
|
||||
const SavedObject = Private(SavedObjectProvider);
|
||||
|
@ -49,7 +50,7 @@ module.factory('SavedDashboard', function (Private, config, i18n) {
|
|||
|
||||
// default values that will get assigned if the doc is new
|
||||
defaults: {
|
||||
title: i18n('kbn.dashboard.savedDashboard.newDashboardTitle', { defaultMessage: 'New Dashboard' }),
|
||||
title: i18n.translate('kbn.dashboard.savedDashboard.newDashboardTitle', { defaultMessage: 'New Dashboard' }),
|
||||
hits: 0,
|
||||
description: '',
|
||||
panelsJSON: '[]',
|
||||
|
|
|
@ -35,7 +35,7 @@ savedObjectManagementRegistry.register({
|
|||
});
|
||||
|
||||
// This is the only thing that gets injected into controllers
|
||||
module.service('savedDashboards', function (Private, SavedDashboard, kbnIndex, kbnUrl, $http, chrome) {
|
||||
module.service('savedDashboards', function (Private, SavedDashboard, kbnUrl, chrome) {
|
||||
const savedObjectClient = Private(SavedObjectsClientProvider);
|
||||
return new SavedObjectLoader(SavedDashboard, kbnUrl, chrome, savedObjectClient);
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { DevToolsRegistryProvider } from 'ui/registry/dev_tools';
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
import 'ui/directives/kbn_href';
|
||||
|
@ -34,24 +35,24 @@ uiRoutes
|
|||
});
|
||||
|
||||
uiRoutes.defaults(/^\/dev_tools(\/|$)/, {
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.dev_tools.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.devTools.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.devTools.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.devTools.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.devTools.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
};
|
||||
},
|
||||
k7Breadcrumbs: (i18n) => [
|
||||
k7Breadcrumbs: () => [
|
||||
{
|
||||
text: i18n('kbn.devTools.k7BreadcrumbsDevToolsLabel', {
|
||||
text: i18n.translate('kbn.devTools.k7BreadcrumbsDevToolsLabel', {
|
||||
defaultMessage: 'Dev Tools'
|
||||
}),
|
||||
href: '#/dev_tools'
|
||||
|
@ -59,13 +60,13 @@ uiRoutes.defaults(/^\/dev_tools(\/|$)/, {
|
|||
]
|
||||
});
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'console',
|
||||
title: i18n('kbn.devTools.consoleTitle', {
|
||||
title: i18n.translate('kbn.devTools.consoleTitle', {
|
||||
defaultMessage: 'Console'
|
||||
}),
|
||||
description: i18n('kbn.devTools.consoleDescription', {
|
||||
description: i18n.translate('kbn.devTools.consoleDescription', {
|
||||
defaultMessage: 'Skip cURL and use this JSON interface to work with your data directly.'
|
||||
}),
|
||||
icon: 'consoleApp',
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import $ from 'jquery';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import html from './discover_field.html';
|
||||
import _ from 'lodash';
|
||||
import 'ui/directives/css_truncate';
|
||||
|
@ -28,7 +29,7 @@ import { capabilities } from 'ui/capabilities';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const app = uiModules.get('apps/discover');
|
||||
|
||||
app.directive('discoverField', function ($compile, i18n) {
|
||||
app.directive('discoverField', function ($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: html,
|
||||
|
@ -50,10 +51,10 @@ app.directive('discoverField', function ($compile, i18n) {
|
|||
}
|
||||
|
||||
$scope.addRemoveButtonLabel = $scope.field.display
|
||||
? i18n('kbn.discover.fieldChooser.discoverField.removeButtonLabel', {
|
||||
? i18n.translate('kbn.discover.fieldChooser.discoverField.removeButtonLabel', {
|
||||
defaultMessage: 'remove',
|
||||
})
|
||||
: i18n('kbn.discover.fieldChooser.discoverField.addButtonLabel', {
|
||||
: i18n.translate('kbn.discover.fieldChooser.discoverField.addButtonLabel', {
|
||||
defaultMessage: 'add',
|
||||
});
|
||||
};
|
||||
|
@ -62,7 +63,7 @@ app.directive('discoverField', function ($compile, i18n) {
|
|||
let warnings = [];
|
||||
|
||||
if (field.scripted) {
|
||||
warnings.push(i18n('kbn.discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription', {
|
||||
warnings.push(i18n.translate('kbn.discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription', {
|
||||
defaultMessage: 'Scripted fields can take a long time to execute.',
|
||||
}));
|
||||
}
|
||||
|
@ -106,11 +107,11 @@ app.directive('discoverField', function ($compile, i18n) {
|
|||
detailScope = $scope.$new();
|
||||
detailScope.warnings = getWarnings(field);
|
||||
detailScope.getBucketAriaLabel = (bucket) => {
|
||||
return i18n('kbn.discover.fieldChooser.discoverField.bucketAriaLabel', {
|
||||
return i18n.translate('kbn.discover.fieldChooser.discoverField.bucketAriaLabel', {
|
||||
defaultMessage: 'Value: {value}',
|
||||
values: {
|
||||
value: bucket.display === ''
|
||||
? i18n('kbn.discover.fieldChooser.discoverField.emptyStringText', {
|
||||
? i18n.translate('kbn.discover.fieldChooser.discoverField.emptyStringText', {
|
||||
defaultMessage: 'Empty string',
|
||||
})
|
||||
: bucket.display,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import 'ui/directives/css_truncate';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ui/directives/field_name';
|
||||
import './discover_field';
|
||||
import 'ui/angular_ui_select';
|
||||
|
@ -30,7 +31,7 @@ import { uiModules } from 'ui/modules';
|
|||
import fieldChooserTemplate from './field_chooser.html';
|
||||
const app = uiModules.get('apps/discover');
|
||||
|
||||
app.directive('discFieldChooser', function ($location, globalState, config, $route, i18n) {
|
||||
app.directive('discFieldChooser', function ($location, config, $route) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
|
@ -48,10 +49,10 @@ app.directive('discFieldChooser', function ($location, globalState, config, $rou
|
|||
link: function ($scope) {
|
||||
$scope.$parent.$watch('showFilter', () =>{
|
||||
$scope.toggleFieldFilterButtonAriaLabel = $scope.$parent.showFilter
|
||||
? i18n('kbn.discover.fieldChooser.toggleFieldFilterButtonHideAriaLabel', {
|
||||
? i18n.translate('kbn.discover.fieldChooser.toggleFieldFilterButtonHideAriaLabel', {
|
||||
defaultMessage: 'Hide field settings',
|
||||
})
|
||||
: i18n('kbn.discover.fieldChooser.toggleFieldFilterButtonShowAriaLabel', {
|
||||
: i18n.translate('kbn.discover.fieldChooser.toggleFieldFilterButtonShowAriaLabel', {
|
||||
defaultMessage: 'Show field settings',
|
||||
});
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
|
@ -95,16 +96,16 @@ uiRoutes
|
|||
? getSavedSearchBreadcrumbs
|
||||
: getRootBreadcrumbs
|
||||
),
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.discover.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.discover.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.discover.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.discover.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.discover.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save searches',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
@ -191,8 +192,7 @@ function discoverController(
|
|||
courier,
|
||||
kbnUrl,
|
||||
localStorage,
|
||||
i18n,
|
||||
uiCapabilities,
|
||||
uiCapabilities
|
||||
) {
|
||||
const visualizeLoader = Private(VisualizeLoaderProvider);
|
||||
let visualizeHandler;
|
||||
|
@ -242,10 +242,10 @@ function discoverController(
|
|||
const getTopNavLinks = () => {
|
||||
const newSearch = {
|
||||
key: 'new',
|
||||
label: i18n('kbn.discover.localMenu.localMenu.newSearchTitle', {
|
||||
label: i18n.translate('kbn.discover.localMenu.localMenu.newSearchTitle', {
|
||||
defaultMessage: 'New',
|
||||
}),
|
||||
description: i18n('kbn.discover.localMenu.newSearchDescription', {
|
||||
description: i18n.translate('kbn.discover.localMenu.newSearchDescription', {
|
||||
defaultMessage: 'New Search',
|
||||
}),
|
||||
run: function () { kbnUrl.change('/discover'); },
|
||||
|
@ -254,10 +254,10 @@ function discoverController(
|
|||
|
||||
const saveSearch = {
|
||||
key: 'save',
|
||||
label: i18n('kbn.discover.localMenu.saveTitle', {
|
||||
label: i18n.translate('kbn.discover.localMenu.saveTitle', {
|
||||
defaultMessage: 'Save',
|
||||
}),
|
||||
description: i18n('kbn.discover.localMenu.saveSearchDescription', {
|
||||
description: i18n.translate('kbn.discover.localMenu.saveSearchDescription', {
|
||||
defaultMessage: 'Save Search',
|
||||
}),
|
||||
testId: 'discoverSaveButton',
|
||||
|
@ -294,10 +294,10 @@ function discoverController(
|
|||
|
||||
const openSearch = {
|
||||
key: 'open',
|
||||
label: i18n('kbn.discover.localMenu.openTitle', {
|
||||
label: i18n.translate('kbn.discover.localMenu.openTitle', {
|
||||
defaultMessage: 'Open',
|
||||
}),
|
||||
description: i18n('kbn.discover.localMenu.openSavedSearchDescription', {
|
||||
description: i18n.translate('kbn.discover.localMenu.openSavedSearchDescription', {
|
||||
defaultMessage: 'Open Saved Search',
|
||||
}),
|
||||
testId: 'discoverOpenButton',
|
||||
|
@ -312,10 +312,10 @@ function discoverController(
|
|||
|
||||
const shareSearch = {
|
||||
key: 'share',
|
||||
label: i18n('kbn.discover.localMenu.shareTitle', {
|
||||
label: i18n.translate('kbn.discover.localMenu.shareTitle', {
|
||||
defaultMessage: 'Share',
|
||||
}),
|
||||
description: i18n('kbn.discover.localMenu.shareSearchDescription', {
|
||||
description: i18n.translate('kbn.discover.localMenu.shareSearchDescription', {
|
||||
defaultMessage: 'Share Search',
|
||||
}),
|
||||
testId: 'shareTopNavButton',
|
||||
|
@ -340,10 +340,10 @@ function discoverController(
|
|||
|
||||
const inspectSearch = {
|
||||
key: 'inspect',
|
||||
label: i18n('kbn.discover.localMenu.inspectTitle', {
|
||||
label: i18n.translate('kbn.discover.localMenu.inspectTitle', {
|
||||
defaultMessage: 'Inspect',
|
||||
}),
|
||||
description: i18n('kbn.discover.localMenu.openInspectorForSearchDescription', {
|
||||
description: i18n.translate('kbn.discover.localMenu.openInspectorForSearchDescription', {
|
||||
defaultMessage: 'Open Inspector for search',
|
||||
}),
|
||||
testId: 'openInspectorButton',
|
||||
|
@ -356,7 +356,7 @@ function discoverController(
|
|||
|
||||
return [
|
||||
newSearch,
|
||||
...uiCapabilities.discover.save ? [saveSearch] : [],
|
||||
...(uiCapabilities.discover.save ? [saveSearch] : []),
|
||||
openSearch,
|
||||
shareSearch,
|
||||
inspectSearch,
|
||||
|
@ -390,7 +390,7 @@ function discoverController(
|
|||
|
||||
const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : '';
|
||||
docTitle.change(`Discover${pageTitleSuffix}`);
|
||||
const discoverBreadcrumbsTitle = i18n('kbn.discover.discoverBreadcrumbTitle', {
|
||||
const discoverBreadcrumbsTitle = i18n.translate('kbn.discover.discoverBreadcrumbTitle', {
|
||||
defaultMessage: 'Discover',
|
||||
});
|
||||
|
||||
|
@ -508,22 +508,20 @@ function discoverController(
|
|||
$state.sort = getSort.array($state.sort, $scope.indexPattern);
|
||||
|
||||
$scope.getBucketIntervalToolTipText = () => {
|
||||
return (
|
||||
i18n('kbn.discover.bucketIntervalTooltip', {
|
||||
// eslint-disable-next-line max-len
|
||||
defaultMessage: 'This interval creates {bucketsDescription} to show in the selected time range, so it has been scaled to {bucketIntervalDescription}',
|
||||
values: {
|
||||
bucketsDescription: $scope.bucketInterval.scale > 1
|
||||
? i18n('kbn.discover.bucketIntervalTooltip.tooLargeBucketsText', {
|
||||
defaultMessage: 'buckets that are too large',
|
||||
})
|
||||
: i18n('kbn.discover.bucketIntervalTooltip.tooManyBucketsText', {
|
||||
defaultMessage: 'too many buckets',
|
||||
}),
|
||||
bucketIntervalDescription: $scope.bucketInterval.description,
|
||||
},
|
||||
})
|
||||
);
|
||||
return i18n.translate('kbn.discover.bucketIntervalTooltip', {
|
||||
// eslint-disable-next-line max-len
|
||||
defaultMessage: 'This interval creates {bucketsDescription} to show in the selected time range, so it has been scaled to {bucketIntervalDescription}',
|
||||
values: {
|
||||
bucketsDescription: $scope.bucketInterval.scale > 1
|
||||
? i18n.translate('kbn.discover.bucketIntervalTooltip.tooLargeBucketsText', {
|
||||
defaultMessage: 'buckets that are too large',
|
||||
})
|
||||
: i18n.translate('kbn.discover.bucketIntervalTooltip.tooManyBucketsText', {
|
||||
defaultMessage: 'too many buckets',
|
||||
}),
|
||||
bucketIntervalDescription: $scope.bucketInterval.description,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$watchCollection('state.columns', function () {
|
||||
|
@ -671,7 +669,7 @@ function discoverController(
|
|||
stateMonitor.setInitialState($state.toJSON());
|
||||
if (id) {
|
||||
toastNotifications.addSuccess({
|
||||
title: i18n('kbn.discover.notifications.savedSearchTitle', {
|
||||
title: i18n.translate('kbn.discover.notifications.savedSearchTitle', {
|
||||
defaultMessage: `Search '{savedSearchTitle}' was saved`,
|
||||
values: {
|
||||
savedSearchTitle: savedSearch.title,
|
||||
|
@ -692,7 +690,7 @@ function discoverController(
|
|||
return { id };
|
||||
} catch(saveError) {
|
||||
toastNotifications.addDanger({
|
||||
title: i18n('kbn.discover.notifications.notSavedSearchTitle', {
|
||||
title: i18n.translate('kbn.discover.notifications.notSavedSearchTitle', {
|
||||
defaultMessage: `Search '{savedSearchTitle}' was not saved.`,
|
||||
values: {
|
||||
savedSearchTitle: savedSearch.title,
|
||||
|
@ -773,10 +771,10 @@ function discoverController(
|
|||
|
||||
function logInspectorRequest() {
|
||||
inspectorAdapters.requests.reset();
|
||||
const title = i18n('kbn.discover.inspectorRequestDataTitle', {
|
||||
const title = i18n.translate('kbn.discover.inspectorRequestDataTitle', {
|
||||
defaultMessage: 'Data',
|
||||
});
|
||||
const description = i18n('kbn.discover.inspectorRequestDescription', {
|
||||
const description = i18n.translate('kbn.discover.inspectorRequestDescription', {
|
||||
defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.',
|
||||
});
|
||||
inspectorRequest = inspectorAdapters.requests.start(title, { description });
|
||||
|
@ -967,7 +965,7 @@ function discoverController(
|
|||
}
|
||||
|
||||
if (stateVal && !stateValFound) {
|
||||
const warningTitle = i18n('kbn.discover.valueIsNotConfiguredIndexPatternIDWarningTitle', {
|
||||
const warningTitle = i18n.translate('kbn.discover.valueIsNotConfiguredIndexPatternIDWarningTitle', {
|
||||
defaultMessage: '{stateVal} is not a configured index pattern ID',
|
||||
values: {
|
||||
stateVal: `"${stateVal}"`,
|
||||
|
@ -977,7 +975,7 @@ function discoverController(
|
|||
if (ownIndexPattern) {
|
||||
toastNotifications.addWarning({
|
||||
title: warningTitle,
|
||||
text: i18n('kbn.discover.showingSavedIndexPatternWarningDescription', {
|
||||
text: i18n.translate('kbn.discover.showingSavedIndexPatternWarningDescription', {
|
||||
defaultMessage: 'Showing the saved index pattern: "{ownIndexPatternTitle}" ({ownIndexPatternId})',
|
||||
values: {
|
||||
ownIndexPatternTitle: ownIndexPattern.title,
|
||||
|
@ -990,7 +988,7 @@ function discoverController(
|
|||
|
||||
toastNotifications.addWarning({
|
||||
title: warningTitle,
|
||||
text: i18n('kbn.discover.showingDefaultIndexPatternWarningDescription', {
|
||||
text: i18n.translate('kbn.discover.showingDefaultIndexPatternWarningDescription', {
|
||||
defaultMessage: 'Showing the default index pattern: "{loadedIndexPatternTitle}" ({loadedIndexPatternId})',
|
||||
values: {
|
||||
loadedIndexPatternTitle: loadedIndexPattern.title,
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { shortenDottedString } from '../../../../common/utils/shorten_dotted_string';
|
||||
import headerHtml from './table_header.html';
|
||||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('app/discover');
|
||||
|
||||
|
||||
module.directive('kbnTableHeader', function (i18n) {
|
||||
module.directive('kbnTableHeader', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
|
@ -55,7 +56,7 @@ module.directive('kbnTableHeader', function (i18n) {
|
|||
$scope.tooltip = function (column) {
|
||||
if (!$scope.isSortableColumn(column)) return '';
|
||||
const name = $scope.isShortDots ? shortenDottedString(column) : column;
|
||||
return i18n('kbn.docTable.tableHeader.sortByColumnTooltip', {
|
||||
return i18n.translate('kbn.docTable.tableHeader.sortByColumnTooltip', {
|
||||
defaultMessage: 'Sort by {columnName}',
|
||||
values: { columnName: name },
|
||||
});
|
||||
|
@ -132,12 +133,12 @@ module.directive('kbnTableHeader', function (i18n) {
|
|||
|
||||
const [currentColumnName, currentDirection = 'asc'] = $scope.sortOrder;
|
||||
if(name === currentColumnName && currentDirection === 'asc') {
|
||||
return i18n('kbn.docTable.tableHeader.sortByColumnDescendingAriaLabel', {
|
||||
return i18n.translate('kbn.docTable.tableHeader.sortByColumnDescendingAriaLabel', {
|
||||
defaultMessage: 'Sort {columnName} descending',
|
||||
values: { columnName: name },
|
||||
});
|
||||
}
|
||||
return i18n('kbn.docTable.tableHeader.sortByColumnAscendingAriaLabel', {
|
||||
return i18n.translate('kbn.docTable.tableHeader.sortByColumnAscendingAriaLabel', {
|
||||
defaultMessage: 'Sort {columnName} ascending',
|
||||
values: { columnName: name },
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import html from './doc_table.html';
|
||||
import { getSort } from './lib/get_sort';
|
||||
import './infinite_scroll';
|
||||
|
@ -32,7 +33,7 @@ import { getRequestInspectorStats, getResponseInspectorStats } from 'ui/courier/
|
|||
import { getLimitedSearchResultsMessage } from './doc_table_strings';
|
||||
|
||||
uiModules.get('app/discover')
|
||||
.directive('docTable', function (config, Notifier, getAppState, pagerFactory, $filter, courier, i18n) {
|
||||
.directive('docTable', function (config, Notifier, getAppState, pagerFactory, $filter, courier) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: html,
|
||||
|
@ -137,10 +138,10 @@ uiModules.get('app/discover')
|
|||
let inspectorRequest = undefined;
|
||||
if (_.has($scope, 'inspectorAdapters.requests')) {
|
||||
$scope.inspectorAdapters.requests.reset();
|
||||
const title = i18n('kbn.docTable.inspectorRequestDataTitle', {
|
||||
const title = i18n.translate('kbn.docTable.inspectorRequestDataTitle', {
|
||||
defaultMessage: 'Data',
|
||||
});
|
||||
const description = i18n('kbn.docTable.inspectorRequestDescription', {
|
||||
const description = i18n.translate('kbn.docTable.inspectorRequestDescription', {
|
||||
defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.',
|
||||
});
|
||||
inspectorRequest = $scope.inspectorAdapters.requests.start(title, { description });
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './saved_searches/saved_searches';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import './directives';
|
||||
import 'ui/collapsible_sidebar';
|
||||
import './components/field_chooser/field_chooser';
|
||||
|
@ -25,13 +26,13 @@ import './controllers/discover';
|
|||
import './doc_table/components/table_row';
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'discover',
|
||||
title: i18n('kbn.discover.discoverTitle', {
|
||||
title: i18n.translate('kbn.discover.discoverTitle', {
|
||||
defaultMessage: 'Discover',
|
||||
}),
|
||||
description: i18n('kbn.discover.discoverDescription', {
|
||||
description: i18n.translate('kbn.discover.discoverDescription', {
|
||||
defaultMessage: 'Interactively explore your data by querying and filtering raw documents.',
|
||||
}),
|
||||
icon: 'discoverApp',
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import 'ui/notify';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { createLegacyClass } from 'ui/utils/legacy_class';
|
||||
import { SavedObjectProvider } from 'ui/saved_objects/saved_object';
|
||||
|
@ -27,7 +28,7 @@ const module = uiModules.get('discover/saved_searches', [
|
|||
'kibana/courier'
|
||||
]);
|
||||
|
||||
module.factory('SavedSearch', function (Private, i18n) {
|
||||
module.factory('SavedSearch', function (Private) {
|
||||
const SavedObject = Private(SavedObjectProvider);
|
||||
createLegacyClass(SavedSearch).inherits(SavedObject);
|
||||
function SavedSearch(id) {
|
||||
|
@ -38,7 +39,7 @@ module.factory('SavedSearch', function (Private, i18n) {
|
|||
|
||||
id: id,
|
||||
defaults: {
|
||||
title: i18n('kbn.discover.savedSearch.newSavedSearchTitle', {
|
||||
title: i18n.translate('kbn.discover.savedSearch.newSavedSearchTitle', {
|
||||
defaultMessage: 'New Saved Search',
|
||||
}),
|
||||
description: '',
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
|
@ -171,13 +172,13 @@ uiModules
|
|||
};
|
||||
});
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'management',
|
||||
title: i18n('kbn.management.managementLabel', {
|
||||
title: i18n.translate('kbn.management.managementLabel', {
|
||||
defaultMessage: 'Management',
|
||||
}),
|
||||
description: i18n('kbn.management.managementDescription', {
|
||||
description: i18n.translate('kbn.management.managementDescription', {
|
||||
defaultMessage: 'Your center console for managing the Elastic Stack.',
|
||||
}),
|
||||
icon: 'managementApp',
|
||||
|
|
|
@ -86,16 +86,16 @@ uiRoutes
|
|||
.defaults(/management\/kibana\/(index_patterns|index_pattern)/, {
|
||||
resolve: indexPatternsResolutions,
|
||||
requireUICapability: 'management.kibana.index_patterns',
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.indexPatterns.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.management.indexPatterns.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.management.indexPatterns.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.management.indexPatterns.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.management.indexPatterns.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save index patterns',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
import 'angular-elastic/elastic';
|
||||
import rison from 'rison-node';
|
||||
|
@ -44,7 +45,7 @@ uiRoutes
|
|||
});
|
||||
|
||||
uiModules.get('apps/management', ['monospaced.elastic'])
|
||||
.directive('kbnManagementObjectsView', function (kbnIndex, confirmModal, i18n) {
|
||||
.directive('kbnManagementObjectsView', function (kbnIndex, confirmModal) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
controller: function ($scope, $injector, $routeParams, $location, $window, $rootScope, Private, uiCapabilities) {
|
||||
|
@ -221,15 +222,15 @@ uiModules.get('apps/management', ['monospaced.elastic'])
|
|||
}
|
||||
const confirmModalOptions = {
|
||||
onConfirm: doDelete,
|
||||
confirmButtonText: i18n('kbn.management.objects.confirmModalOptions.deleteButtonLabel', {
|
||||
confirmButtonText: i18n.translate('kbn.management.objects.confirmModalOptions.deleteButtonLabel', {
|
||||
defaultMessage: 'Delete',
|
||||
}),
|
||||
title: i18n('kbn.management.objects.confirmModalOptions.modalTitle', {
|
||||
title: i18n.translate('kbn.management.objects.confirmModalOptions.modalTitle', {
|
||||
defaultMessage: 'Delete saved Kibana object?'
|
||||
}),
|
||||
};
|
||||
confirmModal(
|
||||
i18n('kbn.management.objects.confirmModalOptions.modalDescription', {
|
||||
i18n.translate('kbn.management.objects.confirmModalOptions.modalDescription', {
|
||||
defaultMessage: 'You can\'t recover deleted objects',
|
||||
}),
|
||||
confirmModalOptions
|
||||
|
|
|
@ -63,16 +63,16 @@ uiRoutes
|
|||
template: indexTemplate,
|
||||
k7Breadcrumbs: getBreadcrumbs,
|
||||
requireUICapability: 'management.kibana.settings',
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.advancedSettings.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.management.advancedSettings.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.management.advancedSettings.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.management.advancedSettings.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.management.advancedSettings.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save advanced settings',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
@ -106,13 +106,13 @@ management.getSection('kibana').register('settings', {
|
|||
url: '#/management/kibana/settings'
|
||||
});
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'advanced_settings',
|
||||
title: i18n('kbn.management.settings.advancedSettingsLabel', {
|
||||
title: i18n.translate('kbn.management.settings.advancedSettingsLabel', {
|
||||
defaultMessage: 'Advanced Settings',
|
||||
}),
|
||||
description: i18n('kbn.management.settings.advancedSettingsDescription', {
|
||||
description: i18n.translate('kbn.management.settings.advancedSettingsDescription', {
|
||||
defaultMessage: 'Directly edit settings that control behavior in Kibana.',
|
||||
}),
|
||||
icon: 'advancedSettingsApp',
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import '../saved_visualizations/saved_visualizations';
|
||||
import './visualization_editor';
|
||||
import 'ui/vis/editors/default/sidebar';
|
||||
|
@ -62,14 +63,14 @@ uiRoutes
|
|||
template: editorTemplate,
|
||||
k7Breadcrumbs: getCreateBreadcrumbs,
|
||||
resolve: {
|
||||
savedVis: function (savedVisualizations, redirectWhenMissing, $route, Private, i18n) {
|
||||
savedVis: function (savedVisualizations, redirectWhenMissing, $route, Private) {
|
||||
const visTypes = Private(VisTypesRegistryProvider);
|
||||
const visType = _.find(visTypes, { name: $route.current.params.type });
|
||||
const shouldHaveIndex = visType.requiresSearch && visType.options.showIndexSelection;
|
||||
const hasIndex = $route.current.params.indexPattern || $route.current.params.savedSearchId;
|
||||
if (shouldHaveIndex && !hasIndex) {
|
||||
throw new Error(
|
||||
i18n('kbn.visualize.createVisualization.noIndexPatternOrSavedSearchIdErrorMessage', {
|
||||
i18n.translate('kbn.visualize.createVisualization.noIndexPatternOrSavedSearchIdErrorMessage', {
|
||||
defaultMessage: 'You must provide either an indexPattern or a savedSearchId',
|
||||
})
|
||||
);
|
||||
|
@ -132,8 +133,7 @@ function VisEditor(
|
|||
Promise,
|
||||
config,
|
||||
kbnBaseUrl,
|
||||
localStorage,
|
||||
i18n
|
||||
localStorage
|
||||
) {
|
||||
const docTitle = Private(DocTitleProvider);
|
||||
const queryFilter = Private(FilterBarQueryFilterProvider);
|
||||
|
@ -153,8 +153,8 @@ function VisEditor(
|
|||
};
|
||||
|
||||
$scope.topNavMenu = [...(capabilities.get().visualize.save ? [{
|
||||
key: i18n('kbn.topNavMenu.saveVisualizationButtonLabel', { defaultMessage: 'save' }),
|
||||
description: i18n('kbn.visualize.topNavMenu.saveVisualizationButtonAriaLabel', {
|
||||
key: i18n.translate('kbn.topNavMenu.saveVisualizationButtonLabel', { defaultMessage: 'save' }),
|
||||
description: i18n.translate('kbn.visualize.topNavMenu.saveVisualizationButtonAriaLabel', {
|
||||
defaultMessage: 'Save Visualization',
|
||||
}),
|
||||
testId: 'visualizeSaveButton',
|
||||
|
@ -163,7 +163,7 @@ function VisEditor(
|
|||
},
|
||||
tooltip() {
|
||||
if (vis.dirty) {
|
||||
return i18n('kbn.visualize.topNavMenu.saveVisualizationDisabledButtonTooltip', {
|
||||
return i18n.translate('kbn.visualize.topNavMenu.saveVisualizationDisabledButtonTooltip', {
|
||||
defaultMessage: 'Apply or Discard your changes before saving'
|
||||
});
|
||||
}
|
||||
|
@ -206,8 +206,8 @@ function VisEditor(
|
|||
showSaveModal(saveModal);
|
||||
}
|
||||
}] : []), {
|
||||
key: i18n('kbn.topNavMenu.shareVisualizationButtonLabel', { defaultMessage: 'share' }),
|
||||
description: i18n('kbn.visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
|
||||
key: i18n.translate('kbn.topNavMenu.shareVisualizationButtonLabel', { defaultMessage: 'share' }),
|
||||
description: i18n.translate('kbn.visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
|
||||
defaultMessage: 'Share Visualization',
|
||||
}),
|
||||
testId: 'shareTopNavButton',
|
||||
|
@ -229,8 +229,8 @@ function VisEditor(
|
|||
});
|
||||
}
|
||||
}, {
|
||||
key: i18n('kbn.topNavMenu.openInspectorButtonLabel', { defaultMessage: 'inspect' }),
|
||||
description: i18n('kbn.visualize.topNavMenu.openInspectorButtonAriaLabel', {
|
||||
key: i18n.translate('kbn.topNavMenu.openInspectorButtonLabel', { defaultMessage: 'inspect' }),
|
||||
description: i18n.translate('kbn.visualize.topNavMenu.openInspectorButtonAriaLabel', {
|
||||
defaultMessage: 'Open Inspector for visualization',
|
||||
}),
|
||||
testId: 'openInspectorButton',
|
||||
|
@ -246,14 +246,14 @@ function VisEditor(
|
|||
},
|
||||
tooltip() {
|
||||
if (!vis.hasInspector || !vis.hasInspector()) {
|
||||
return i18n('kbn.visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
|
||||
return i18n.translate('kbn.visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
|
||||
defaultMessage: `This visualization doesn't support any inspectors.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: i18n('kbn.topNavMenu.refreshButtonLabel', { defaultMessage: 'refresh' }),
|
||||
description: i18n('kbn.visualize.topNavMenu.refreshButtonAriaLabel', {
|
||||
key: i18n.translate('kbn.topNavMenu.refreshButtonLabel', { defaultMessage: 'refresh' }),
|
||||
description: i18n.translate('kbn.visualize.topNavMenu.refreshButtonAriaLabel', {
|
||||
defaultMessage: 'Refresh',
|
||||
}),
|
||||
run: function () {
|
||||
|
@ -486,7 +486,7 @@ function VisEditor(
|
|||
|
||||
if (id) {
|
||||
toastNotifications.addSuccess({
|
||||
title: i18n('kbn.visualize.topNavMenu.saveVisualization.successNotificationText', {
|
||||
title: i18n.translate('kbn.visualize.topNavMenu.saveVisualization.successNotificationText', {
|
||||
defaultMessage: `Saved '{visTitle}'`,
|
||||
values: {
|
||||
visTitle: savedVis.title,
|
||||
|
@ -525,7 +525,7 @@ function VisEditor(
|
|||
// eslint-disable-next-line
|
||||
console.error(error);
|
||||
toastNotifications.addDanger({
|
||||
title: i18n('kbn.visualize.topNavMenu.saveVisualization.failureNotificationText', {
|
||||
title: i18n.translate('kbn.visualize.topNavMenu.saveVisualization.failureNotificationText', {
|
||||
defaultMessage: `Error on saving '{visTitle}'`,
|
||||
values: {
|
||||
visTitle: savedVis.title,
|
||||
|
@ -555,7 +555,7 @@ function VisEditor(
|
|||
searchSource.setParent(searchSourceGrandparent);
|
||||
|
||||
toastNotifications.addSuccess(
|
||||
i18n('kbn.visualize.linkedToSearch.unlinkSuccessNotificationText', {
|
||||
i18n.translate('kbn.visualize.linkedToSearch.unlinkSuccessNotificationText', {
|
||||
defaultMessage: `Unlinked from saved search '{searchTitle}'`,
|
||||
values: {
|
||||
searchTitle: savedVis.savedSearch.title
|
||||
|
@ -568,12 +568,10 @@ function VisEditor(
|
|||
|
||||
|
||||
$scope.getAdditionalMessage = () => {
|
||||
return (
|
||||
'<i class="kuiIcon fa-flask"></i>' +
|
||||
i18n('kbn.visualize.experimentalVisInfoText', { defaultMessage: 'This visualization is marked as experimental.' }) +
|
||||
' ' +
|
||||
vis.type.feedbackMessage
|
||||
);
|
||||
return '<i class="kuiIcon fa-flask"></i>' +
|
||||
i18n.translate('kbn.visualize.experimentalVisInfoText', { defaultMessage: 'This visualization is marked as experimental.' }) +
|
||||
' ' +
|
||||
vis.type.feedbackMessage;
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './editor/editor';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import './saved_visualizations/_saved_vis';
|
||||
import './saved_visualizations/saved_visualizations';
|
||||
import 'ui/filter_bar';
|
||||
|
@ -33,16 +34,16 @@ uiRoutes
|
|||
.defaults(/visualize/, {
|
||||
requireDefaultIndex: true,
|
||||
requireUICapability: 'visualize.show',
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.visualize.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('kbn.visualize.badge.readOnly.text', {
|
||||
text: i18n.translate('kbn.visualize.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('kbn.visualize.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('kbn.visualize.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save visualizations',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
@ -68,11 +69,11 @@ uiRoutes
|
|||
},
|
||||
});
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'visualize',
|
||||
title: 'Visualize',
|
||||
description: i18n(
|
||||
description: i18n.translate(
|
||||
'kbn.visualize.visualizeDescription',
|
||||
{
|
||||
defaultMessage: 'Create visualizations and aggregate data stores in your Elasticsearch indices.',
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
|
||||
import { VisProvider } from 'ui/vis';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { updateOldState } from 'ui/vis/vis_update_state';
|
||||
import { VisualizeConstants } from '../visualize_constants';
|
||||
|
@ -38,7 +39,7 @@ import {
|
|||
|
||||
uiModules
|
||||
.get('app/visualize')
|
||||
.factory('SavedVis', function (config, $injector, Promise, savedSearches, Private, i18n) {
|
||||
.factory('SavedVis', function (Promise, savedSearches, Private) {
|
||||
const Vis = Private(VisProvider);
|
||||
const SavedObject = Private(SavedObjectProvider);
|
||||
createLegacyClass(SavedVis).inherits(SavedObject);
|
||||
|
@ -57,7 +58,7 @@ uiModules
|
|||
id: opts.id,
|
||||
indexPattern: opts.indexPattern,
|
||||
defaults: {
|
||||
title: i18n('kbn.visualize.defaultVisualizationTitle', {
|
||||
title: i18n.translate('kbn.visualize.defaultVisualizationTitle', {
|
||||
defaultMessage: 'New Visualization',
|
||||
}),
|
||||
visState: (function () {
|
||||
|
|
|
@ -32,7 +32,7 @@ savedObjectManagementRegistry.register({
|
|||
title: 'visualizations'
|
||||
});
|
||||
|
||||
app.service('savedVisualizations', function (Promise, kbnIndex, SavedVis, Private, kbnUrl, $http, chrome) {
|
||||
app.service('savedVisualizations', function (SavedVis, Private, kbnUrl, chrome) {
|
||||
const visTypes = Private(VisTypesRegistryProvider);
|
||||
|
||||
const savedObjectClient = Private(SavedObjectsClientProvider);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import { MarkdownVisWrapper } from './markdown_vis_controller';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import markdownVisParamsTemplate from './markdown_vis_params.html';
|
||||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
|
@ -29,7 +30,7 @@ import { DefaultEditorSize } from 'ui/vis/editor_size';
|
|||
// register the provider with the visTypes registry so that other know it exists
|
||||
VisTypesRegistryProvider.register(MarkdownVisProvider);
|
||||
|
||||
function MarkdownVisProvider(Private, i18n) {
|
||||
function MarkdownVisProvider(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
// return the visType object, which kibana will use to display and configure new
|
||||
|
@ -39,7 +40,7 @@ function MarkdownVisProvider(Private, i18n) {
|
|||
title: 'Markdown',
|
||||
isAccessible: true,
|
||||
icon: 'visText',
|
||||
description: i18n('markdownVis.markdownDescription', { defaultMessage: 'Create a document using markdown syntax' }),
|
||||
description: i18n.translate('markdownVis.markdownDescription', { defaultMessage: 'Create a document using markdown syntax' }),
|
||||
visConfig: {
|
||||
component: MarkdownVisWrapper,
|
||||
defaults: {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './metric_vis_params';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
|
@ -30,16 +31,16 @@ import { MetricVisComponent } from './metric_vis_controller';
|
|||
// register the provider with the visTypes registry
|
||||
VisTypesRegistryProvider.register(MetricVisProvider);
|
||||
|
||||
function MetricVisProvider(Private, i18n) {
|
||||
function MetricVisProvider(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
// return the visType object, which kibana will use to display and configure new
|
||||
// Vis object of this type.
|
||||
return VisFactory.createReactVisualization({
|
||||
name: 'metric',
|
||||
title: i18n('metricVis.metricTitle', { defaultMessage: 'Metric' }),
|
||||
title: i18n.translate('metricVis.metricTitle', { defaultMessage: 'Metric' }),
|
||||
icon: 'visMetric',
|
||||
description: i18n('metricVis.metricDescription', { defaultMessage: 'Display a calculation as a single number' }),
|
||||
description: i18n.translate('metricVis.metricDescription', { defaultMessage: 'Display a calculation as a single number' }),
|
||||
visConfig: {
|
||||
component: MetricVisComponent,
|
||||
defaults: {
|
||||
|
@ -73,15 +74,15 @@ function MetricVisProvider(Private, i18n) {
|
|||
metricColorMode: [
|
||||
{
|
||||
id: 'None',
|
||||
label: i18n('metricVis.colorModes.noneOptionLabel', { defaultMessage: 'None' })
|
||||
label: i18n.translate('metricVis.colorModes.noneOptionLabel', { defaultMessage: 'None' })
|
||||
},
|
||||
{
|
||||
id: 'Labels',
|
||||
label: i18n('metricVis.colorModes.labelsOptionLabel', { defaultMessage: 'Labels' })
|
||||
label: i18n.translate('metricVis.colorModes.labelsOptionLabel', { defaultMessage: 'Labels' })
|
||||
},
|
||||
{
|
||||
id: 'Background',
|
||||
label: i18n('metricVis.colorModes.backgroundOptionLabel', { defaultMessage: 'Background' })
|
||||
label: i18n.translate('metricVis.colorModes.backgroundOptionLabel', { defaultMessage: 'Background' })
|
||||
}
|
||||
],
|
||||
colorSchemas: Object.values(vislibColorMaps).map(value => ({ id: value.id, label: value.label })),
|
||||
|
@ -91,7 +92,7 @@ function MetricVisProvider(Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('metricVis.schemas.metricTitle', { defaultMessage: 'Metric' }),
|
||||
title: i18n.translate('metricVis.schemas.metricTitle', { defaultMessage: 'Metric' }),
|
||||
min: 1,
|
||||
aggFilter: [
|
||||
'!std_dev', '!geo_centroid',
|
||||
|
@ -102,7 +103,7 @@ function MetricVisProvider(Private, i18n) {
|
|||
}, {
|
||||
group: 'buckets',
|
||||
name: 'group',
|
||||
title: i18n('metricVis.schemas.splitGroupTitle', { defaultMessage: 'Split Group' }),
|
||||
title: i18n.translate('metricVis.schemas.splitGroupTitle', { defaultMessage: 'Split Group' }),
|
||||
min: 0,
|
||||
max: 1,
|
||||
aggFilter: ['!geohash_grid', '!geotile_grid', '!filter']
|
||||
|
|
|
@ -18,12 +18,13 @@
|
|||
*/
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ui/directives/inequality';
|
||||
import metricVisParamsTemplate from './metric_vis_params.html';
|
||||
import _ from 'lodash';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('metricVisParams', function (i18n) {
|
||||
module.directive('metricVisParams', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: metricVisParamsTemplate,
|
||||
|
@ -81,7 +82,8 @@ module.directive('metricVisParams', function (i18n) {
|
|||
$scope.customColors = true;
|
||||
});
|
||||
|
||||
$scope.editorState.requiredDescription = i18n('metricVis.params.ranges.warning.requiredDescription', { defaultMessage: 'Required:' });
|
||||
$scope.editorState.requiredDescription = i18n.translate(
|
||||
'metricVis.params.ranges.warning.requiredDescription', { defaultMessage: 'Required:' });
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import { MetricsRequestHandlerProvider } from './request_handler';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { ReactEditorControllerProvider } from './editor_controller';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message';
|
||||
|
@ -28,15 +29,15 @@ import { PANEL_TYPES } from '../../common/panel_types';
|
|||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
VisTypesRegistryProvider.register(MetricsVisProvider);
|
||||
|
||||
export default function MetricsVisProvider(Private, i18n) {
|
||||
export default function MetricsVisProvider(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
const ReactEditorController = Private(ReactEditorControllerProvider).handler;
|
||||
const metricsRequestHandler = Private(MetricsRequestHandlerProvider).handler;
|
||||
|
||||
return VisFactory.createReactVisualization({
|
||||
name: 'metrics',
|
||||
title: i18n('tsvb.kbnVisTypes.metricsTitle', { defaultMessage: 'Visual Builder' }),
|
||||
description: i18n('tsvb.kbnVisTypes.metricsDescription',
|
||||
title: i18n.translate('tsvb.kbnVisTypes.metricsTitle', { defaultMessage: 'Visual Builder' }),
|
||||
description: i18n.translate('tsvb.kbnVisTypes.metricsDescription',
|
||||
{ defaultMessage: 'Build time-series using a visual pipeline interface' }),
|
||||
icon: 'visVisualBuilder',
|
||||
feedbackMessage: defaultFeedbackMessage,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './region_map_vis_params';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
|
@ -27,7 +28,7 @@ import { RegionMapsVisualizationProvider } from './region_map_visualization';
|
|||
import { Status } from 'ui/vis/update_status';
|
||||
import { ORIGIN } from '../../../../legacy/core_plugins/tile_map/common/origin';
|
||||
|
||||
VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config, i18n) {
|
||||
VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config) {
|
||||
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
const RegionMapsVisualization = Private(RegionMapsVisualizationProvider);
|
||||
|
@ -39,8 +40,8 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps
|
|||
|
||||
return VisFactory.createBaseVisualization({
|
||||
name: 'region_map',
|
||||
title: i18n('regionMap.mapVis.regionMapTitle', { defaultMessage: 'Region Map' }),
|
||||
description: i18n('regionMap.mapVis.regionMapDescription', { defaultMessage: 'Show metrics on a thematic map. Use one of the \
|
||||
title: i18n.translate('regionMap.mapVis.regionMapTitle', { defaultMessage: 'Region Map' }),
|
||||
description: i18n.translate('regionMap.mapVis.regionMapDescription', { defaultMessage: 'Show metrics on a thematic map. Use one of the \
|
||||
provided base maps, or add your own. Darker colors represent higher values.' }),
|
||||
icon: 'visMapRegion',
|
||||
visConfig: {
|
||||
|
@ -66,16 +67,16 @@ provided base maps, or add your own. Darker colors represent higher values.' }),
|
|||
collections: {
|
||||
legendPositions: [{
|
||||
value: 'bottomleft',
|
||||
text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomLeftText', { defaultMessage: 'bottom left' }),
|
||||
text: i18n.translate('regionMap.mapVis.regionMapEditorConfig.bottomLeftText', { defaultMessage: 'bottom left' }),
|
||||
}, {
|
||||
value: 'bottomright',
|
||||
text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomRightText', { defaultMessage: 'bottom right' }),
|
||||
text: i18n.translate('regionMap.mapVis.regionMapEditorConfig.bottomRightText', { defaultMessage: 'bottom right' }),
|
||||
}, {
|
||||
value: 'topleft',
|
||||
text: i18n('regionMap.mapVis.regionMapEditorConfig.topLeftText', { defaultMessage: 'top left' }),
|
||||
text: i18n.translate('regionMap.mapVis.regionMapEditorConfig.topLeftText', { defaultMessage: 'top left' }),
|
||||
}, {
|
||||
value: 'topright',
|
||||
text: i18n('regionMap.mapVis.regionMapEditorConfig.topRightText', { defaultMessage: 'top right' }),
|
||||
text: i18n.translate('regionMap.mapVis.regionMapEditorConfig.topRightText', { defaultMessage: 'top right' }),
|
||||
}],
|
||||
colorSchemas: Object.values(truncatedColorMaps).map(value => ({ id: value.id, label: value.label })),
|
||||
vectorLayers: vectorLayers,
|
||||
|
@ -85,7 +86,7 @@ provided base maps, or add your own. Darker colors represent higher values.' }),
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.metricTitle', { defaultMessage: 'Value' }),
|
||||
title: i18n.translate('regionMap.mapVis.regionMapEditorConfig.schemas.metricTitle', { defaultMessage: 'Value' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits',
|
||||
|
@ -98,7 +99,7 @@ provided base maps, or add your own. Darker colors represent higher values.' }),
|
|||
group: 'buckets',
|
||||
name: 'segment',
|
||||
icon: 'fa fa-globe',
|
||||
title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.segmentTitle', { defaultMessage: 'shape field' }),
|
||||
title: i18n.translate('regionMap.mapVis.regionMapEditorConfig.schemas.segmentTitle', { defaultMessage: 'shape field' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['terms']
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import 'plugins/kbn_vislib_vis_types/controls/vislib_basic_options';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { BaseMapsVisualizationProvider } from '../../tile_map/public/base_maps_visualization';
|
||||
import ChoroplethLayer from './choropleth_layer';
|
||||
import { truncatedColorMaps } from 'ui/vislib/components/color/truncated_colormaps';
|
||||
|
@ -26,7 +27,7 @@ import { TileMapTooltipFormatter } from './tooltip_formatter';
|
|||
import 'ui/vis/map/service_settings';
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
|
||||
export function RegionMapsVisualizationProvider(Private, config, i18n) {
|
||||
export function RegionMapsVisualizationProvider(Private, config) {
|
||||
|
||||
const tooltipFormatter = Private(TileMapTooltipFormatter);
|
||||
const BaseMapsVisualization = Private(BaseMapsVisualizationProvider);
|
||||
|
@ -162,14 +163,14 @@ export function RegionMapsVisualizationProvider(Private, config, i18n) {
|
|||
const shouldShowWarning = this._params.isDisplayWarning && config.get('visualization:regionmap:showWarnings');
|
||||
if (event.mismatches.length > 0 && shouldShowWarning) {
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('regionMap.visualization.unableToShowMismatchesWarningTitle', {
|
||||
title: i18n.translate('regionMap.visualization.unableToShowMismatchesWarningTitle', {
|
||||
defaultMessage: 'Unable to show {mismatchesLength} {oneMismatch, plural, one {result} other {results}} on map',
|
||||
values: {
|
||||
mismatchesLength: event.mismatches.length,
|
||||
oneMismatch: event.mismatches.length > 1 ? 0 : 1,
|
||||
},
|
||||
}),
|
||||
text: i18n('regionMap.visualization.unableToShowMismatchesWarningText', {
|
||||
text: i18n.translate('regionMap.visualization.unableToShowMismatchesWarningText', {
|
||||
defaultMessage: 'Ensure that each of these term matches a shape on that shape\'s join field: {mismatches}',
|
||||
values: {
|
||||
mismatches: event.mismatches ? event.mismatches.join(', ') : '',
|
||||
|
|
|
@ -18,21 +18,22 @@
|
|||
*/
|
||||
|
||||
import './tag_cloud_vis_params';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { Schemas } from 'ui/vis/editors/default/schemas';
|
||||
import { TagCloudVisualization } from './tag_cloud_visualization';
|
||||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
import { Status } from 'ui/vis/update_status';
|
||||
|
||||
VisTypesRegistryProvider.register(function (Private, i18n) {
|
||||
VisTypesRegistryProvider.register(function (Private) {
|
||||
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
|
||||
return VisFactory.createBaseVisualization({
|
||||
name: 'tagcloud',
|
||||
title: i18n('tagCloud.vis.tagCloudTitle', { defaultMessage: 'Tag Cloud' }),
|
||||
title: i18n.translate('tagCloud.vis.tagCloudTitle', { defaultMessage: 'Tag Cloud' }),
|
||||
icon: 'visTagCloud',
|
||||
description: i18n('tagCloud.vis.tagCloudDescription', {
|
||||
description: i18n.translate('tagCloud.vis.tagCloudDescription', {
|
||||
defaultMessage: 'A group of words, sized according to their importance'
|
||||
}),
|
||||
visConfig: {
|
||||
|
@ -56,7 +57,7 @@ VisTypesRegistryProvider.register(function (Private, i18n) {
|
|||
{
|
||||
group: 'metrics',
|
||||
name: 'metric',
|
||||
title: i18n('tagCloud.vis.schemas.metricTitle', { defaultMessage: 'Tag Size' }),
|
||||
title: i18n.translate('tagCloud.vis.schemas.metricTitle', { defaultMessage: 'Tag Size' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['!std_dev', '!percentiles', '!percentile_ranks', '!derivative', '!geo_bounds', '!geo_centroid'],
|
||||
|
@ -68,7 +69,7 @@ VisTypesRegistryProvider.register(function (Private, i18n) {
|
|||
group: 'buckets',
|
||||
name: 'segment',
|
||||
icon: 'fa fa-cloud',
|
||||
title: i18n('tagCloud.vis.schemas.segmentTitle', { defaultMessage: 'Tags' }),
|
||||
title: i18n.translate('tagCloud.vis.schemas.segmentTitle', { defaultMessage: 'Tags' }),
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['terms', 'significant_terms']
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { KibanaMap } from 'ui/vis/map/kibana_map';
|
||||
import * as Rx from 'rxjs';
|
||||
import { filter, first } from 'rxjs/operators';
|
||||
|
@ -35,7 +36,7 @@ const emsServiceSettings = new Promise((resolve) => {
|
|||
});
|
||||
});
|
||||
|
||||
export function BaseMapsVisualizationProvider(serviceSettings, i18n) {
|
||||
export function BaseMapsVisualizationProvider(serviceSettings) {
|
||||
|
||||
/**
|
||||
* Abstract base class for a visualization consisting of a map with a single baselayer.
|
||||
|
@ -209,7 +210,7 @@ export function BaseMapsVisualizationProvider(serviceSettings, i18n) {
|
|||
}
|
||||
|
||||
async _updateData() {
|
||||
throw new Error(i18n('tileMap.baseMapsVisualization.childShouldImplementMethodErrorMessage', {
|
||||
throw new Error(i18n.translate('tileMap.baseMapsVisualization.childShouldImplementMethodErrorMessage', {
|
||||
defaultMessage: 'Child should implement this method to respond to data-update',
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
|
||||
import $ from 'jquery';
|
||||
|
||||
export function TileMapTooltipFormatterProvider($compile, $rootScope, i18n) {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export function TileMapTooltipFormatterProvider($compile, $rootScope) {
|
||||
|
||||
const $tooltipScope = $rootScope.$new();
|
||||
const $el = $('<div>').html(require('./_tooltip.html'));
|
||||
|
@ -37,11 +39,11 @@ export function TileMapTooltipFormatterProvider($compile, $rootScope, i18n) {
|
|||
value: metricAgg.fieldFormatter()(feature.properties.value)
|
||||
},
|
||||
{
|
||||
label: i18n('tileMap.tooltipFormatter.latitudeLabel', { defaultMessage: 'Latitude' }),
|
||||
label: i18n.translate('tileMap.tooltipFormatter.latitudeLabel', { defaultMessage: 'Latitude' }),
|
||||
value: feature.geometry.coordinates[1]
|
||||
},
|
||||
{
|
||||
label: i18n('tileMap.tooltipFormatter.longitudeLabel', { defaultMessage: 'Longitude' }),
|
||||
label: i18n.translate('tileMap.tooltipFormatter.longitudeLabel', { defaultMessage: 'Longitude' }),
|
||||
value: feature.geometry.coordinates[0]
|
||||
}
|
||||
];
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
*/
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import wmsOptionsTemplate from './wms_options.html';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('wmsOptions', function (serviceSettings, i18n) {
|
||||
module.directive('wmsOptions', function (serviceSettings) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: wmsOptionsTemplate,
|
||||
|
@ -31,7 +32,7 @@ module.directive('wmsOptions', function (serviceSettings, i18n) {
|
|||
collections: '=',
|
||||
},
|
||||
link: function ($scope) {
|
||||
$scope.wmsLinkText = i18n('tileMap.wmsOptions.wmsLinkText', { defaultMessage: 'here' });
|
||||
$scope.wmsLinkText = i18n.translate('tileMap.wmsOptions.wmsLinkText', { defaultMessage: 'here' });
|
||||
|
||||
new Promise((resolve, reject) => {
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { capabilities } from 'ui/capabilities';
|
||||
import { DocTitleProvider } from 'ui/doc_title';
|
||||
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
|
||||
|
@ -72,16 +74,16 @@ require('ui/routes')
|
|||
? getSavedSheetBreadcrumbs
|
||||
: getCreateBreadcrumbs
|
||||
),
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.timelion.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('timelion.badge.readOnly.text', {
|
||||
text: i18n.translate('timelion.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('timelion.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('timelion.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save Timelion sheets',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
@ -120,8 +122,7 @@ app.controller('timelion', function (
|
|||
courier,
|
||||
kbnUrl,
|
||||
Notifier,
|
||||
Private,
|
||||
i18n,
|
||||
Private
|
||||
) {
|
||||
|
||||
// Keeping this at app scope allows us to keep the current page when the user
|
||||
|
@ -167,10 +168,10 @@ app.controller('timelion', function (
|
|||
|
||||
const newSheetAction = {
|
||||
key: 'new',
|
||||
label: i18n('timelion.topNavMenu.newSheetButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.newSheetButtonLabel', {
|
||||
defaultMessage: 'New',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.newSheetButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.newSheetButtonAriaLabel', {
|
||||
defaultMessage: 'New Sheet',
|
||||
}),
|
||||
run: function () { kbnUrl.change('/'); },
|
||||
|
@ -179,10 +180,10 @@ app.controller('timelion', function (
|
|||
|
||||
const addSheetAction = {
|
||||
key: 'add',
|
||||
label: i18n('timelion.topNavMenu.addChartButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.addChartButtonLabel', {
|
||||
defaultMessage: 'Add',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.addChartButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.addChartButtonAriaLabel', {
|
||||
defaultMessage: 'Add a chart',
|
||||
}),
|
||||
run: function () { $scope.newCell(); },
|
||||
|
@ -191,10 +192,10 @@ app.controller('timelion', function (
|
|||
|
||||
const saveSheetAction = {
|
||||
key: 'save',
|
||||
label: i18n('timelion.topNavMenu.saveSheetButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.saveSheetButtonLabel', {
|
||||
defaultMessage: 'Save',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.saveSheetButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.saveSheetButtonAriaLabel', {
|
||||
defaultMessage: 'Save Sheet',
|
||||
}),
|
||||
template: require('plugins/timelion/partials/save_sheet.html'),
|
||||
|
@ -203,10 +204,10 @@ app.controller('timelion', function (
|
|||
|
||||
const deleteSheetAction = {
|
||||
key: 'delete',
|
||||
label: i18n('timelion.topNavMenu.deleteSheetButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.deleteSheetButtonLabel', {
|
||||
defaultMessage: 'Delete',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.deleteSheetButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.deleteSheetButtonAriaLabel', {
|
||||
defaultMessage: 'Delete current sheet',
|
||||
}),
|
||||
disableButton: function () {
|
||||
|
@ -216,7 +217,7 @@ app.controller('timelion', function (
|
|||
const title = savedSheet.title;
|
||||
function doDelete() {
|
||||
savedSheet.delete().then(() => {
|
||||
toastNotifications.addSuccess(i18n(
|
||||
toastNotifications.addSuccess(i18n.translate(
|
||||
'timelion.topNavMenu.delete.modal.successNotificationText',
|
||||
{
|
||||
defaultMessage: `Deleted '{title}'`,
|
||||
|
@ -229,17 +230,17 @@ app.controller('timelion', function (
|
|||
|
||||
const confirmModalOptions = {
|
||||
onConfirm: doDelete,
|
||||
confirmButtonText: i18n('timelion.topNavMenu.delete.modal.confirmButtonLabel', {
|
||||
confirmButtonText: i18n.translate('timelion.topNavMenu.delete.modal.confirmButtonLabel', {
|
||||
defaultMessage: 'Delete',
|
||||
}),
|
||||
title: i18n('timelion.topNavMenu.delete.modalTitle', {
|
||||
title: i18n.translate('timelion.topNavMenu.delete.modalTitle', {
|
||||
defaultMessage: `Delete Timelion sheet '{title}'?`,
|
||||
values: { title }
|
||||
}),
|
||||
};
|
||||
|
||||
confirmModal(
|
||||
i18n('timelion.topNavMenu.delete.modal.warningText', {
|
||||
i18n.translate('timelion.topNavMenu.delete.modal.warningText', {
|
||||
defaultMessage: `You can't recover deleted sheets.`,
|
||||
}),
|
||||
confirmModalOptions
|
||||
|
@ -250,10 +251,10 @@ app.controller('timelion', function (
|
|||
|
||||
const openSheetAction = {
|
||||
key: 'open',
|
||||
label: i18n('timelion.topNavMenu.openSheetButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.openSheetButtonLabel', {
|
||||
defaultMessage: 'Open',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.openSheetButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.openSheetButtonAriaLabel', {
|
||||
defaultMessage: 'Open Sheet',
|
||||
}),
|
||||
template: require('plugins/timelion/partials/load_sheet.html'),
|
||||
|
@ -262,10 +263,10 @@ app.controller('timelion', function (
|
|||
|
||||
const optionsAction = {
|
||||
key: 'options',
|
||||
label: i18n('timelion.topNavMenu.optionsButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.optionsButtonLabel', {
|
||||
defaultMessage: 'Options',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.optionsButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.optionsButtonAriaLabel', {
|
||||
defaultMessage: 'Options',
|
||||
}),
|
||||
template: require('plugins/timelion/partials/sheet_options.html'),
|
||||
|
@ -274,10 +275,10 @@ app.controller('timelion', function (
|
|||
|
||||
const helpAction = {
|
||||
key: 'help',
|
||||
label: i18n('timelion.topNavMenu.helpButtonLabel', {
|
||||
label: i18n.translate('timelion.topNavMenu.helpButtonLabel', {
|
||||
defaultMessage: 'Help',
|
||||
}),
|
||||
description: i18n('timelion.topNavMenu.helpButtonAriaLabel', {
|
||||
description: i18n.translate('timelion.topNavMenu.helpButtonAriaLabel', {
|
||||
defaultMessage: 'Help',
|
||||
}),
|
||||
template: '<timelion-help></timelion-help>',
|
||||
|
@ -395,7 +396,7 @@ app.controller('timelion', function (
|
|||
savedSheet.save().then(function (id) {
|
||||
if (id) {
|
||||
toastNotifications.addSuccess({
|
||||
title: i18n('timelion.saveSheet.successNotificationText', {
|
||||
title: i18n.translate('timelion.saveSheet.successNotificationText', {
|
||||
defaultMessage: `Saved sheet '{title}'`,
|
||||
values: { title: savedSheet.title },
|
||||
}),
|
||||
|
@ -420,7 +421,7 @@ app.controller('timelion', function (
|
|||
savedExpression.save().then(function (id) {
|
||||
if (id) {
|
||||
toastNotifications.addSuccess(
|
||||
i18n('timelion.saveExpression.successNotificationText', {
|
||||
i18n.translate('timelion.saveExpression.successNotificationText', {
|
||||
defaultMessage: `Saved expression '{title}'`,
|
||||
values: { title: savedExpression.title },
|
||||
}),
|
||||
|
|
|
@ -18,9 +18,11 @@
|
|||
*/
|
||||
import panelRegistryProvider from '../../lib/panel_registry';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
require('ui/modules')
|
||||
.get('apps/timelion', [])
|
||||
.directive('chart', function (Private, i18n) {
|
||||
.directive('chart', function (Private) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
|
@ -47,7 +49,7 @@ require('ui/modules')
|
|||
|
||||
if (!panelSchema) {
|
||||
$elem.text(
|
||||
i18n('timelion.chart.seriesList.noSchemaWarning', {
|
||||
i18n.translate('timelion.chart.seriesList.noSchemaWarning', {
|
||||
defaultMessage: 'No such panel type: {renderType}',
|
||||
values: { renderType: $scope.seriesList.render.type },
|
||||
})
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import template from './timelion_help.html';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import _ from 'lodash';
|
||||
import moment from 'moment';
|
||||
|
@ -25,7 +26,7 @@ import '../../components/timelionhelp_tabs_directive';
|
|||
|
||||
const app = uiModules.get('apps/timelion', []);
|
||||
|
||||
app.directive('timelionHelp', function ($http, i18n) {
|
||||
app.directive('timelionHelp', function ($http) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template,
|
||||
|
@ -46,46 +47,46 @@ app.directive('timelionHelp', function ($http, i18n) {
|
|||
};
|
||||
|
||||
$scope.translations = {
|
||||
nextButtonLabel: i18n('timelion.help.nextPageButtonLabel', {
|
||||
nextButtonLabel: i18n.translate('timelion.help.nextPageButtonLabel', {
|
||||
defaultMessage: 'Next',
|
||||
}),
|
||||
previousButtonLabel: i18n('timelion.help.previousPageButtonLabel', {
|
||||
previousButtonLabel: i18n.translate('timelion.help.previousPageButtonLabel', {
|
||||
defaultMessage: 'Previous',
|
||||
}),
|
||||
dontShowHelpButtonLabel: i18n('timelion.help.dontShowHelpButtonLabel', {
|
||||
dontShowHelpButtonLabel: i18n.translate('timelion.help.dontShowHelpButtonLabel', {
|
||||
defaultMessage: `Don't show this again`,
|
||||
}),
|
||||
strongNextText: i18n('timelion.help.welcome.content.strongNextText', {
|
||||
strongNextText: i18n.translate('timelion.help.welcome.content.strongNextText', {
|
||||
defaultMessage: 'Next',
|
||||
}),
|
||||
emphasizedEverythingText: i18n('timelion.help.welcome.content.emphasizedEverythingText', {
|
||||
emphasizedEverythingText: i18n.translate('timelion.help.welcome.content.emphasizedEverythingText', {
|
||||
defaultMessage: 'everything',
|
||||
}),
|
||||
notValidAdvancedSettingsPath: i18n('timelion.help.configuration.notValid.advancedSettingsPathText', {
|
||||
notValidAdvancedSettingsPath: i18n.translate('timelion.help.configuration.notValid.advancedSettingsPathText', {
|
||||
defaultMessage: 'Management / Kibana / Advanced Settings'
|
||||
}),
|
||||
validAdvancedSettingsPath: i18n('timelion.help.configuration.valid.advancedSettingsPathText', {
|
||||
validAdvancedSettingsPath: i18n.translate('timelion.help.configuration.valid.advancedSettingsPathText', {
|
||||
defaultMessage: 'Management/Kibana/Advanced Settings',
|
||||
}),
|
||||
esAsteriskQueryDescription: i18n('timelion.help.querying.esAsteriskQueryDescriptionText', {
|
||||
esAsteriskQueryDescription: i18n.translate('timelion.help.querying.esAsteriskQueryDescriptionText', {
|
||||
defaultMessage: 'hey Elasticsearch, find everything in my default index',
|
||||
}),
|
||||
esIndexQueryDescription: i18n('timelion.help.querying.esIndexQueryDescriptionText', {
|
||||
esIndexQueryDescription: i18n.translate('timelion.help.querying.esIndexQueryDescriptionText', {
|
||||
defaultMessage: 'use * as the q (query) for the logstash-* index',
|
||||
}),
|
||||
strongAddText: i18n('timelion.help.expressions.strongAddText', {
|
||||
strongAddText: i18n.translate('timelion.help.expressions.strongAddText', {
|
||||
defaultMessage: 'Add',
|
||||
}),
|
||||
twoExpressionsDescriptionTitle: i18n('timelion.help.expressions.examples.twoExpressionsDescriptionTitle', {
|
||||
twoExpressionsDescriptionTitle: i18n.translate('timelion.help.expressions.examples.twoExpressionsDescriptionTitle', {
|
||||
defaultMessage: 'Double the fun.',
|
||||
}),
|
||||
customStylingDescriptionTitle: i18n('timelion.help.expressions.examples.customStylingDescriptionTitle', {
|
||||
customStylingDescriptionTitle: i18n.translate('timelion.help.expressions.examples.customStylingDescriptionTitle', {
|
||||
defaultMessage: 'Custom styling.',
|
||||
}),
|
||||
namedArgumentsDescriptionTitle: i18n('timelion.help.expressions.examples.namedArgumentsDescriptionTitle', {
|
||||
namedArgumentsDescriptionTitle: i18n.translate('timelion.help.expressions.examples.namedArgumentsDescriptionTitle', {
|
||||
defaultMessage: 'Named arguments.',
|
||||
}),
|
||||
groupedExpressionsDescriptionTitle: i18n('timelion.help.expressions.examples.groupedExpressionsDescriptionTitle', {
|
||||
groupedExpressionsDescriptionTitle: i18n.translate('timelion.help.expressions.examples.groupedExpressionsDescriptionTitle', {
|
||||
defaultMessage: 'Grouped expressions.',
|
||||
}),
|
||||
};
|
||||
|
@ -125,7 +126,7 @@ app.directive('timelionHelp', function ($http, i18n) {
|
|||
} catch (e) {
|
||||
if (_.get(resp, 'data.resp.message')) return _.get(resp, 'data.resp.message');
|
||||
if (_.get(resp, 'data.resp.output.payload.message')) return _.get(resp, 'data.resp.output.payload.message');
|
||||
return i18n('timelion.help.unknownErrorMessage', { defaultMessage: 'Unknown error' });
|
||||
return i18n.translate('timelion.help.unknownErrorMessage', { defaultMessage: 'Unknown error' });
|
||||
}
|
||||
}());
|
||||
}
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export default function Panel(name, config, i18n) {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export default function Panel(name, config) {
|
||||
|
||||
this.name = name;
|
||||
|
||||
|
@ -27,7 +29,7 @@ export default function Panel(name, config, i18n) {
|
|||
|
||||
if (!config.render) {
|
||||
throw new Error (
|
||||
i18n('timelion.panels.noRenderFunctionErrorMessage', {
|
||||
i18n.translate('timelion.panels.noRenderFunctionErrorMessage', {
|
||||
defaultMessage: 'Panel must have a rendering function'
|
||||
})
|
||||
);
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
*/
|
||||
|
||||
import Panel from '../panel';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import panelRegistry from '../../lib/panel_registry';
|
||||
|
||||
panelRegistry.register(function timeChartProvider(Private, i18n) {
|
||||
panelRegistry.register(function timeChartProvider(Private) {
|
||||
// Schema is broken out so that it may be extended for use in other plugins
|
||||
// Its also easier to test.
|
||||
return new Panel('timechart', Private(require('./schema'))(), i18n);
|
||||
|
|
|
@ -19,14 +19,16 @@
|
|||
|
||||
import moment from 'moment';
|
||||
|
||||
export default function xaxisFormatterProvider(config, i18n) {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export default function xaxisFormatterProvider(config) {
|
||||
|
||||
function getFormat(esInterval) {
|
||||
const parts = esInterval.match(/(\d+)(ms|s|m|h|d|w|M|y|)/);
|
||||
|
||||
if (parts == null || parts[1] == null || parts[2] == null) {
|
||||
throw new Error (
|
||||
i18n('timelion.panels.timechart.unknownIntervalErrorMessage', {
|
||||
i18n.translate('timelion.panels.timechart.unknownIntervalErrorMessage', {
|
||||
defaultMessage: 'Unknown interval',
|
||||
})
|
||||
);
|
||||
|
|
|
@ -22,11 +22,13 @@ import {
|
|||
FeatureCatalogueCategory,
|
||||
} from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'timelion',
|
||||
title: 'Timelion',
|
||||
description: i18n('timelion.registerFeatureDescription', {
|
||||
description: i18n.translate('timelion.registerFeatureDescription', {
|
||||
defaultMessage:
|
||||
'Use an expression language to analyze time series data and visualize the results.',
|
||||
}),
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import { VisFactoryProvider } from 'ui/vis/vis_factory';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
|
||||
import { TimelionRequestHandlerProvider } from './timelion_request_handler';
|
||||
import { DefaultEditorSize } from 'ui/vis/editor_size';
|
||||
|
@ -32,7 +33,7 @@ import editorConfigTemplate from './timelion_vis_params.html';
|
|||
// register the provider with the visTypes registry so that other know it exists
|
||||
VisTypesRegistryProvider.register(TimelionVisProvider);
|
||||
|
||||
export default function TimelionVisProvider(Private, i18n) {
|
||||
export default function TimelionVisProvider(Private) {
|
||||
const VisFactory = Private(VisFactoryProvider);
|
||||
const timelionRequestHandler = Private(TimelionRequestHandlerProvider);
|
||||
|
||||
|
@ -42,7 +43,7 @@ export default function TimelionVisProvider(Private, i18n) {
|
|||
name: 'timelion',
|
||||
title: 'Timelion',
|
||||
icon: 'visTimelion',
|
||||
description: i18n('timelion.timelionDescription', {
|
||||
description: i18n.translate('timelion.timelionDescription', {
|
||||
defaultMessage: 'Build time-series using functional expressions',
|
||||
}),
|
||||
visConfig: {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import $ from 'jquery';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { template } from 'lodash';
|
||||
import { shortenDottedString } from '../../../core_plugins/kibana/common/utils/shorten_dotted_string';
|
||||
import booleanFieldNameIcon from './field_name_icons/boolean_field_name_icon.html';
|
||||
|
@ -45,7 +46,7 @@ const compiledSourceFieldNameIcon = template(sourceFieldNameIcon);
|
|||
const compiledStringFieldNameIcon = template(stringFieldNameIcon);
|
||||
const compiledUnknownFieldNameIcon = template(unknownFieldNameIcon);
|
||||
|
||||
module.directive('fieldName', function ($compile, $rootScope, config, i18n) {
|
||||
module.directive('fieldName', function ($compile, $rootScope, config) {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
scope: {
|
||||
|
@ -56,47 +57,47 @@ module.directive('fieldName', function ($compile, $rootScope, config, i18n) {
|
|||
link: function ($scope, $el) {
|
||||
const typeToIconMap = {
|
||||
boolean: compiledBooleanFieldNameIcon({
|
||||
booleanFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.booleanAriaLabel', {
|
||||
booleanFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.booleanAriaLabel', {
|
||||
defaultMessage: 'Boolean field'
|
||||
}),
|
||||
}),
|
||||
conflict: compiledConflictFieldNameIcon({
|
||||
conflictingFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.conflictFieldAriaLabel', {
|
||||
conflictingFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.conflictFieldAriaLabel', {
|
||||
defaultMessage: 'Conflicting field'
|
||||
}),
|
||||
}),
|
||||
date: compiledDateFieldNameIcon({
|
||||
dateFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.dateFieldAriaLabel', {
|
||||
dateFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.dateFieldAriaLabel', {
|
||||
defaultMessage: 'Date field'
|
||||
}),
|
||||
}),
|
||||
geo_point: compiledGeoPointFieldNameIcon({
|
||||
geoPointFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.geoPointFieldAriaLabel', {
|
||||
geoPointFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.geoPointFieldAriaLabel', {
|
||||
defaultMessage: 'Date field'
|
||||
}),
|
||||
}),
|
||||
ip: compiledIpFieldNameIcon({
|
||||
ipAddressFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.ipAddressFieldAriaLabel', {
|
||||
ipAddressFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.ipAddressFieldAriaLabel', {
|
||||
defaultMessage: 'IP address field'
|
||||
}),
|
||||
}),
|
||||
murmur3: compiledMurmur3FieldNameIcon({
|
||||
murmur3FieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.murmur3FieldAriaLabel', {
|
||||
murmur3FieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.murmur3FieldAriaLabel', {
|
||||
defaultMessage: 'Murmur3 field'
|
||||
}),
|
||||
}),
|
||||
number: compiledNumberFieldNameIcon({
|
||||
numberFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.numberFieldAriaLabel', {
|
||||
numberFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.numberFieldAriaLabel', {
|
||||
defaultMessage: 'Number field'
|
||||
}),
|
||||
}),
|
||||
source: compiledSourceFieldNameIcon({
|
||||
sourceFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.sourceFieldAriaLabel', {
|
||||
sourceFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.sourceFieldAriaLabel', {
|
||||
defaultMessage: 'Source field'
|
||||
}),
|
||||
}),
|
||||
string: compiledStringFieldNameIcon({
|
||||
stringFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.stringFieldAriaLabel', {
|
||||
stringFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.stringFieldAriaLabel', {
|
||||
defaultMessage: 'String field'
|
||||
}),
|
||||
}),
|
||||
|
@ -108,7 +109,7 @@ module.directive('fieldName', function ($compile, $rootScope, config, i18n) {
|
|||
}
|
||||
|
||||
return compiledUnknownFieldNameIcon({
|
||||
unknownFieldAriaLabel: i18n('common.ui.directives.fieldNameIcons.unknownFieldAriaLabel', {
|
||||
unknownFieldAriaLabel: i18n.translate('common.ui.directives.fieldNameIcons.unknownFieldAriaLabel', {
|
||||
defaultMessage: 'Unknown field'
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from '../modules';
|
||||
import paginateControlsTemplate from './partials/paginate_controls.html';
|
||||
|
||||
uiModules.get('kibana')
|
||||
.directive('paginate', function ($parse, $compile, i18n) {
|
||||
.directive('paginate', function ($parse, $compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: true,
|
||||
|
@ -61,7 +62,7 @@ uiModules.get('kibana')
|
|||
controller: function ($scope, $document) {
|
||||
const self = this;
|
||||
const ALL = 0;
|
||||
const allSizeTitle = i18n('common.ui.directives.paginate.size.allDropDownOptionLabel', {
|
||||
const allSizeTitle = i18n.translate('common.ui.directives.paginate.size.allDropDownOptionLabel', {
|
||||
defaultMessage: 'All',
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export function decorateFormController($delegate, $injector, i18n) {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export function decorateFormController($delegate, $injector) {
|
||||
const [directive] = $delegate;
|
||||
const FormController = directive.controller;
|
||||
|
||||
|
@ -52,7 +54,7 @@ export function decorateFormController($delegate, $injector, i18n) {
|
|||
|
||||
describeErrors() {
|
||||
const count = this.softErrorCount();
|
||||
return i18n('common.ui.fancyForm.errorDescription',
|
||||
return i18n.translate('common.ui.fancyForm.errorDescription',
|
||||
{
|
||||
defaultMessage: '{count, plural, one {# Error} other {# Errors}}',
|
||||
values: { count }
|
||||
|
@ -99,3 +101,4 @@ export function decorateFormController($delegate, $injector, i18n) {
|
|||
|
||||
return $delegate;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import angular from 'angular';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { noop } from 'lodash';
|
||||
import { uiModules } from '../modules';
|
||||
import template from './confirm_modal.html';
|
||||
|
@ -44,7 +45,7 @@ export const ConfirmationButtonTypes = {
|
|||
* @property {String=} title - If given, shows a title on the confirm modal.
|
||||
*/
|
||||
|
||||
module.factory('confirmModal', function ($rootScope, $compile, i18n) {
|
||||
module.factory('confirmModal', function ($rootScope, $compile) {
|
||||
let modalPopover;
|
||||
const confirmQueue = [];
|
||||
|
||||
|
@ -55,7 +56,7 @@ module.factory('confirmModal', function ($rootScope, $compile, i18n) {
|
|||
return function confirmModal(message, customOptions) {
|
||||
const defaultOptions = {
|
||||
onCancel: noop,
|
||||
cancelButtonText: i18n('common.ui.modals.cancelButtonLabel', {
|
||||
cancelButtonText: i18n.translate('common.ui.modals.cancelButtonLabel', {
|
||||
defaultMessage: 'Cancel'
|
||||
}),
|
||||
defaultFocusedButton: ConfirmationButtonTypes.CONFIRM
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import truncText from 'trunc-text';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import truncHTML from 'trunc-html';
|
||||
import { uiModules } from '../../modules';
|
||||
import truncatedTemplate from '../partials/truncated.html';
|
||||
|
@ -25,7 +26,7 @@ import 'angular-sanitize';
|
|||
|
||||
const module = uiModules.get('kibana', ['ngSanitize']);
|
||||
|
||||
module.directive('kbnTruncated', function (i18n) {
|
||||
module.directive('kbnTruncated', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
|
@ -48,10 +49,10 @@ module.directive('kbnTruncated', function (i18n) {
|
|||
}
|
||||
$scope.truncated = true;
|
||||
$scope.expanded = false;
|
||||
const showLessText = i18n('common.ui.directives.truncated.showLessLinkText', {
|
||||
const showLessText = i18n.translate('common.ui.directives.truncated.showLessLinkText', {
|
||||
defaultMessage: 'less'
|
||||
});
|
||||
const showMoreText = i18n('common.ui.directives.truncated.showMoreLinkText', {
|
||||
const showMoreText = i18n.translate('common.ui.directives.truncated.showMoreLinkText', {
|
||||
defaultMessage: 'more'
|
||||
});
|
||||
$scope.action = showMoreText;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
import rison from 'rison-node';
|
||||
import { applyDiff } from '../utils/diff_object';
|
||||
|
@ -41,7 +42,7 @@ import {
|
|||
isStateHash,
|
||||
} from './state_storage';
|
||||
|
||||
export function StateProvider(Private, $rootScope, $location, stateManagementConfig, config, kbnUrl, i18n) {
|
||||
export function StateProvider(Private, $rootScope, $location, stateManagementConfig, config, kbnUrl) {
|
||||
const Events = Private(EventsProvider);
|
||||
|
||||
createLegacyClass(State).inherits(Events);
|
||||
|
@ -103,7 +104,7 @@ export function StateProvider(Private, $rootScope, $location, stateManagementCon
|
|||
}
|
||||
|
||||
if (unableToParse) {
|
||||
toastNotifications.addDanger(i18n('common.ui.stateManagement.unableToParseUrlErrorMessage', {
|
||||
toastNotifications.addDanger(i18n.translate('common.ui.stateManagement.unableToParseUrlErrorMessage', {
|
||||
defaultMessage: 'Unable to parse URL'
|
||||
}));
|
||||
search[this._urlParam] = this.toQueryParam(this._defaults);
|
||||
|
@ -244,7 +245,7 @@ export function StateProvider(Private, $rootScope, $location, stateManagementCon
|
|||
State.prototype._parseStateHash = function (stateHash) {
|
||||
const json = this._hashedItemStore.getItem(stateHash);
|
||||
if (json === null) {
|
||||
toastNotifications.addDanger(i18n('common.ui.stateManagement.unableToRestoreUrlErrorMessage', {
|
||||
toastNotifications.addDanger(i18n.translate('common.ui.stateManagement.unableToRestoreUrlErrorMessage', {
|
||||
defaultMessage: 'Unable to completely restore the URL, be sure to use the share functionality.'
|
||||
}));
|
||||
}
|
||||
|
@ -293,7 +294,7 @@ export function StateProvider(Private, $rootScope, $location, stateManagementCon
|
|||
}
|
||||
|
||||
// If we ran out of space trying to persist the state, notify the user.
|
||||
const message = i18n('common.ui.stateManagement.unableToStoreHistoryInSessionErrorMessage', {
|
||||
const message = i18n.translate('common.ui.stateManagement.unableToStoreHistoryInSessionErrorMessage', {
|
||||
defaultMessage: 'Kibana is unable to store history items in your session ' +
|
||||
`because it is full and there don't seem to be items any items safe ` +
|
||||
'to delete.\n\n' +
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { MarkdownSimple } from 'ui/markdown';
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
import { SavedObjectNotFound } from '../errors';
|
||||
|
@ -27,7 +28,7 @@ import { uiModules } from '../modules';
|
|||
uiModules.get('kibana/url')
|
||||
.service('redirectWhenMissing', function (Private) { return Private(RedirectWhenMissingProvider); });
|
||||
|
||||
export function RedirectWhenMissingProvider($location, kbnUrl, Promise, i18n) {
|
||||
export function RedirectWhenMissingProvider($location, kbnUrl, Promise) {
|
||||
/**
|
||||
* Creates an error handler that will redirect to a url when a SavedObjectNotFound
|
||||
* error is thrown
|
||||
|
@ -57,7 +58,7 @@ export function RedirectWhenMissingProvider($location, kbnUrl, Promise, i18n) {
|
|||
url += (url.indexOf('?') >= 0 ? '&' : '?') + `notFound=${error.savedObjectType}`;
|
||||
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('common.ui.url.savedObjectIsMissingNotificationMessage', {
|
||||
title: i18n.translate('common.ui.url.savedObjectIsMissingNotificationMessage', {
|
||||
defaultMessage: 'Saved object is missing'
|
||||
}),
|
||||
text: <MarkdownSimple>{error.message}</MarkdownSimple>,
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from '../modules';
|
||||
import { AppStateProvider } from '../state_management/app_state';
|
||||
|
||||
uiModules.get('kibana/url')
|
||||
.service('kbnUrl', function (Private) { return Private(KbnUrlProvider); });
|
||||
|
||||
export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private, i18n) {
|
||||
export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) {
|
||||
/**
|
||||
* the `kbnUrl` service was created to smooth over some of the
|
||||
* inconsistent behavior that occurs when modifying the url via
|
||||
|
@ -113,7 +114,7 @@ export function KbnUrlProvider($injector, $location, $rootScope, $parse, Private
|
|||
// if evaluation can't be made, throw
|
||||
if (_.isUndefined(p)) {
|
||||
throw new Error(
|
||||
i18n('common.ui.url.replacementFailedErrorMessage', {
|
||||
i18n.translate('common.ui.url.replacementFailedErrorMessage', {
|
||||
defaultMessage: 'Replacement failed, unresolved expression: {expr}',
|
||||
values: { expr }
|
||||
}));
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import './sidebar';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import './vis_options';
|
||||
import './vis_editor_resizer';
|
||||
import './vis_type_agg_filter';
|
||||
|
@ -33,7 +34,7 @@ import { VisEditorTypesRegistryProvider } from '../../../registry/vis_editor_typ
|
|||
import { getVisualizeLoader } from '../../../visualize/loader/visualize_loader';
|
||||
|
||||
|
||||
const defaultEditor = function ($rootScope, $compile, i18n) {
|
||||
const defaultEditor = function ($rootScope, $compile) {
|
||||
return class DefaultEditor {
|
||||
static key = 'default';
|
||||
|
||||
|
@ -46,7 +47,7 @@ const defaultEditor = function ($rootScope, $compile, i18n) {
|
|||
this.vis.type.editorConfig.optionTabs = [
|
||||
{
|
||||
name: 'options',
|
||||
title: i18n('common.ui.vis.editors.sidebar.tabs.optionsLabel', { defaultMessage: 'Options' }),
|
||||
title: i18n.translate('common.ui.vis.editors.sidebar.tabs.optionsLabel', { defaultMessage: 'Options' }),
|
||||
editor: this.vis.type.editorConfig.optionsTemplate,
|
||||
}
|
||||
];
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import html from './vislib_vis_legend.html';
|
||||
import { VislibLibDataProvider } from '../../vislib/lib/data';
|
||||
import { uiModules } from '../../modules';
|
||||
|
@ -28,7 +29,7 @@ import { getTableAggs } from '../../visualize/loader/pipeline_helpers/utilities'
|
|||
export const CUSTOM_LEGEND_VIS_TYPES = ['heatmap', 'gauge'];
|
||||
|
||||
uiModules.get('kibana')
|
||||
.directive('vislibLegend', function (Private, $timeout, i18n) {
|
||||
.directive('vislibLegend', function (Private, $timeout) {
|
||||
const Data = Private(VislibLibDataProvider);
|
||||
const visFilters = Private(VisFiltersProvider);
|
||||
|
||||
|
@ -134,7 +135,7 @@ uiModules.get('kibana')
|
|||
function refresh() {
|
||||
const vislibVis = $scope.vis.vislibVis;
|
||||
if (!vislibVis || !vislibVis.visConfig) {
|
||||
$scope.labels = [{ label: i18n('common.ui.vis.visTypes.legend.loadingLabel', { defaultMessage: 'loading…' }) }];
|
||||
$scope.labels = [{ label: i18n.translate('common.ui.vis.visTypes.legend.loadingLabel', { defaultMessage: 'loading…' }) }];
|
||||
return;
|
||||
} // make sure vislib is defined at this point
|
||||
|
||||
|
|
|
@ -5,17 +5,18 @@
|
|||
*/
|
||||
|
||||
import chrome from 'ui/chrome';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import {
|
||||
FeatureCatalogueRegistryProvider,
|
||||
FeatureCatalogueCategory
|
||||
} from 'ui/registry/feature_catalogue';
|
||||
|
||||
if (chrome.getInjected('apmUiEnabled')) {
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'apm',
|
||||
title: 'APM',
|
||||
description: i18n('xpack.apm.apmDescription', {
|
||||
description: i18n.translate('xpack.apm.apmDescription', {
|
||||
defaultMessage:
|
||||
'Automatically collect in-depth performance metrics and ' +
|
||||
'errors from inside your applications.'
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import d3 from 'd3';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ace';
|
||||
import rison from 'rison-node';
|
||||
import React from 'react';
|
||||
|
@ -108,12 +109,12 @@ uiRoutes
|
|||
template: appTemplate,
|
||||
k7Breadcrumbs: getWorkspaceBreadcrumbs,
|
||||
resolve: {
|
||||
savedWorkspace: function (savedGraphWorkspaces, courier, $route, i18n) {
|
||||
savedWorkspace: function (savedGraphWorkspaces, courier, $route) {
|
||||
return savedGraphWorkspaces.get($route.current.params.id)
|
||||
.catch(
|
||||
function () {
|
||||
toastNotifications.addDanger(
|
||||
i18n('xpack.graph.missingWorkspaceErrorMessage', {
|
||||
i18n.translate('xpack.graph.missingWorkspaceErrorMessage', {
|
||||
defaultMessage: 'Missing workspace',
|
||||
})
|
||||
);
|
||||
|
@ -147,7 +148,17 @@ uiRoutes
|
|||
|
||||
|
||||
//======== Controller for basic UI ==================
|
||||
app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private, Promise, confirmModal, kbnBaseUrl, i18n, config) {
|
||||
app.controller('graphuiPlugin', function (
|
||||
$scope,
|
||||
$route,
|
||||
$http,
|
||||
kbnUrl,
|
||||
Private,
|
||||
Promise,
|
||||
confirmModal,
|
||||
kbnBaseUrl,
|
||||
config
|
||||
) {
|
||||
function handleSuccess(data) {
|
||||
return checkLicense(Private, Promise, kbnBaseUrl)
|
||||
.then(() => data);
|
||||
|
@ -305,11 +316,11 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
const confirmModalOptions = {
|
||||
onConfirm: yesFn,
|
||||
onCancel: noFn,
|
||||
confirmButtonText: i18n('xpack.graph.clearWorkspace.confirmButtonLabel', {
|
||||
confirmButtonText: i18n.translate('xpack.graph.clearWorkspace.confirmButtonLabel', {
|
||||
defaultMessage: 'Clear workspace',
|
||||
})
|
||||
};
|
||||
confirmModal(i18n('xpack.graph.clearWorkspace.confirmText', {
|
||||
confirmModal(i18n.translate('xpack.graph.clearWorkspace.confirmText', {
|
||||
defaultMessage: 'This will clear the workspace - are you sure?',
|
||||
}), confirmModalOptions);
|
||||
}
|
||||
|
@ -407,7 +418,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
.then(function (resp) {
|
||||
if (resp.data.resp.timed_out) {
|
||||
toastNotifications.addWarning(
|
||||
i18n('xpack.graph.exploreGraph.timedOutWarningText', {
|
||||
i18n.translate('xpack.graph.exploreGraph.timedOutWarningText', {
|
||||
defaultMessage: 'Exploration timed out',
|
||||
})
|
||||
);
|
||||
|
@ -559,10 +570,10 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
const found = $scope.newUrlTemplate.url.search(drillDownRegex) > -1;
|
||||
if (!found) {
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('xpack.graph.settings.drillDowns.invalidUrlWarningTitle', {
|
||||
title: i18n.translate('xpack.graph.settings.drillDowns.invalidUrlWarningTitle', {
|
||||
defaultMessage: 'Invalid URL',
|
||||
}),
|
||||
text: i18n('xpack.graph.settings.drillDowns.invalidUrlWarningText', {
|
||||
text: i18n.translate('xpack.graph.settings.drillDowns.invalidUrlWarningText', {
|
||||
defaultMessage: 'The URL must contain a {placeholder} string',
|
||||
values: {
|
||||
placeholder: '{{gquery}}'
|
||||
|
@ -587,13 +598,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
const i = $scope.urlTemplates.indexOf(urlTemplate);
|
||||
if (i != -1) {
|
||||
confirmModal(
|
||||
i18n('xpack.graph.settings.drillDowns.removeConfirmText', {
|
||||
i18n.translate('xpack.graph.settings.drillDowns.removeConfirmText', {
|
||||
defaultMessage: 'Remove "{urlTemplateDesciption}" drill-down?',
|
||||
values: { urlTemplateDesciption: urlTemplate.description },
|
||||
}),
|
||||
{
|
||||
onConfirm: () => $scope.urlTemplates.splice(i, 1),
|
||||
confirmButtonText: i18n('xpack.graph.settings.drillDowns.removeConfirmButtonLabel', {
|
||||
confirmButtonText: i18n.translate('xpack.graph.settings.drillDowns.removeConfirmButtonLabel', {
|
||||
defaultMessage: 'Remove drill-down',
|
||||
}),
|
||||
},
|
||||
|
@ -692,7 +703,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
|
||||
$scope.urlTemplates.push({
|
||||
url: discoverUrl,
|
||||
description: i18n('xpack.graph.settings.drillDowns.defaultUrlTemplateTitle', {
|
||||
description: i18n.translate('xpack.graph.settings.drillDowns.defaultUrlTemplateTitle', {
|
||||
defaultMessage: 'Raw documents',
|
||||
}),
|
||||
encoder: $scope.outlinkEncoders[0],
|
||||
|
@ -764,7 +775,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
|
||||
if ($scope.indices.length === 0) {
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('xpack.graph.noDataSourceNotificationMessageTitle', {
|
||||
title: i18n.translate('xpack.graph.noDataSourceNotificationMessageTitle', {
|
||||
defaultMessage: 'No data source',
|
||||
}),
|
||||
text: (
|
||||
|
@ -793,13 +804,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
$scope.topNavMenu = [];
|
||||
$scope.topNavMenu.push({
|
||||
key: 'new',
|
||||
label: i18n('xpack.graph.topNavMenu.newWorkspaceLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.newWorkspaceLabel', {
|
||||
defaultMessage: 'New',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.newWorkspaceAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.newWorkspaceAriaLabel', {
|
||||
defaultMessage: 'New Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.newWorkspaceTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.newWorkspaceTooltip', {
|
||||
defaultMessage: 'Create a new workspace',
|
||||
}),
|
||||
run: function () {canWipeWorkspace(function () {kbnUrl.change('/home', {}); }); },
|
||||
|
@ -812,13 +823,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
if (!$scope.allSavingDisabled) {
|
||||
$scope.topNavMenu.push({
|
||||
key: 'save',
|
||||
label: i18n('xpack.graph.topNavMenu.saveWorkspace.enabledLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.enabledLabel', {
|
||||
defaultMessage: 'Save',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.saveWorkspace.enabledAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.enabledAriaLabel', {
|
||||
defaultMessage: 'Save Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.saveWorkspace.enabledTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.enabledTooltip', {
|
||||
defaultMessage: 'Save this workspace',
|
||||
}),
|
||||
disableButton: function () {return $scope.selectedFields.length === 0;},
|
||||
|
@ -828,13 +839,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
} else {
|
||||
$scope.topNavMenu.push({
|
||||
key: 'save',
|
||||
label: i18n('xpack.graph.topNavMenu.saveWorkspace.disabledLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.disabledLabel', {
|
||||
defaultMessage: 'Save',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.saveWorkspace.disabledAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.disabledAriaLabel', {
|
||||
defaultMessage: 'Save Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.saveWorkspace.disabledTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.saveWorkspace.disabledTooltip', {
|
||||
defaultMessage: 'No changes to saved workspaces are permitted by the current save policy',
|
||||
}),
|
||||
disableButton: true,
|
||||
|
@ -844,13 +855,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
}
|
||||
$scope.topNavMenu.push({
|
||||
key: 'open',
|
||||
label: i18n('xpack.graph.topNavMenu.loadWorkspaceLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.loadWorkspaceLabel', {
|
||||
defaultMessage: 'Open',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.loadWorkspaceAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.loadWorkspaceAriaLabel', {
|
||||
defaultMessage: 'Load Saved Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.loadWorkspaceTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.loadWorkspaceTooltip', {
|
||||
defaultMessage: 'Load a saved workspace',
|
||||
}),
|
||||
template: require('./templates/load_workspace.html'),
|
||||
|
@ -867,13 +878,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
disableButton: function () {
|
||||
return $route.current.locals === undefined || $route.current.locals.savedWorkspace === undefined;
|
||||
},
|
||||
label: i18n('xpack.graph.topNavMenu.deleteWorkspace.enabledLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.enabledLabel', {
|
||||
defaultMessage: 'Delete',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.deleteWorkspace.enabledAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.enabledAriaLabel', {
|
||||
defaultMessage: 'Delete Saved Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.deleteWorkspace.enabledAriaTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.enabledAriaTooltip', {
|
||||
defaultMessage: 'Delete this workspace',
|
||||
}),
|
||||
testId: 'graphDeleteButton',
|
||||
|
@ -884,7 +895,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
kbnUrl.change('/home', {});
|
||||
|
||||
toastNotifications.addSuccess(
|
||||
i18n('xpack.graph.topNavMenu.deleteWorkspaceNotification', {
|
||||
i18n.translate('xpack.graph.topNavMenu.deleteWorkspaceNotification', {
|
||||
defaultMessage: `Deleted '{workspaceTitle}'`,
|
||||
values: { workspaceTitle: title },
|
||||
})
|
||||
|
@ -892,12 +903,12 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
}
|
||||
const confirmModalOptions = {
|
||||
onConfirm: doDelete,
|
||||
confirmButtonText: i18n('xpack.graph.topNavMenu.deleteWorkspace.confirmButtonLabel', {
|
||||
confirmButtonText: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.confirmButtonLabel', {
|
||||
defaultMessage: 'Delete workspace',
|
||||
}),
|
||||
};
|
||||
confirmModal(
|
||||
i18n('xpack.graph.topNavMenu.deleteWorkspace.confirmText', {
|
||||
i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.confirmText', {
|
||||
defaultMessage: 'Are you sure you want to delete the workspace {title} ?',
|
||||
values: { title },
|
||||
}),
|
||||
|
@ -909,13 +920,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
$scope.topNavMenu.push({
|
||||
key: 'delete',
|
||||
disableButton: true,
|
||||
label: i18n('xpack.graph.topNavMenu.deleteWorkspace.disabledLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.disabledLabel', {
|
||||
defaultMessage: 'Delete',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.deleteWorkspace.disabledAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.disabledAriaLabel', {
|
||||
defaultMessage: 'Delete Saved Workspace',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.topNavMenu.deleteWorkspace.disabledTooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.topNavMenu.deleteWorkspace.disabledTooltip', {
|
||||
defaultMessage: 'No changes to saved workspaces are permitted by the current save policy',
|
||||
}),
|
||||
testId: 'graphDeleteButton',
|
||||
|
@ -925,10 +936,10 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
$scope.topNavMenu.push({
|
||||
key: 'settings',
|
||||
disableButton: function () { return $scope.selectedIndex === null; },
|
||||
label: i18n('xpack.graph.topNavMenu.settingsLabel', {
|
||||
label: i18n.translate('xpack.graph.topNavMenu.settingsLabel', {
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
description: i18n('xpack.graph.topNavMenu.settingsAriaLabel', {
|
||||
description: i18n.translate('xpack.graph.topNavMenu.settingsAriaLabel', {
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
template: require('./templates/settings.html')
|
||||
|
@ -970,7 +981,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
});
|
||||
if(!savedObjectIndexPattern) {
|
||||
toastNotifications.addDanger(
|
||||
i18n('xpack.graph.loadWorkspace.missingIndexPatternErrorMessage', {
|
||||
i18n.translate('xpack.graph.loadWorkspace.missingIndexPatternErrorMessage', {
|
||||
defaultMessage: 'Missing index pattern {indexPattern}',
|
||||
values: { indexPattern: wsObj.indexPattern },
|
||||
})
|
||||
|
@ -1092,7 +1103,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
// It should not be possible to navigate to this function if allSavingDisabled is set
|
||||
// but adding check here as a safeguard.
|
||||
toastNotifications.addWarning(
|
||||
i18n('xpack.graph.saveWorkspace.disabledWarning', { defaultMessage: 'Saving is disabled' })
|
||||
i18n.translate('xpack.graph.saveWorkspace.disabledWarning', { defaultMessage: 'Saving is disabled' })
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -1181,13 +1192,13 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
|
|||
$scope.kbnTopNav.close('save');
|
||||
$scope.userHasConfirmedSaveWorkspaceData = false; //reset flag
|
||||
if (id) {
|
||||
const title = i18n('xpack.graph.saveWorkspace.successNotificationTitle', {
|
||||
const title = i18n.translate('xpack.graph.saveWorkspace.successNotificationTitle', {
|
||||
defaultMessage: 'Saved "{workspaceTitle}"',
|
||||
values: { workspaceTitle: $scope.savedWorkspace.title },
|
||||
});
|
||||
let text;
|
||||
if (!canSaveData && $scope.workspace.nodes.length > 0) {
|
||||
text = i18n('xpack.graph.saveWorkspace.successNotification.noDataSavedText', {
|
||||
text = i18n.translate('xpack.graph.saveWorkspace.successNotification.noDataSavedText', {
|
||||
defaultMessage: 'The configuration was saved, but the data was not saved',
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,17 +4,18 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export function getReadonlyBadge(i18n, uiCapabilities) {
|
||||
export function getReadonlyBadge(uiCapabilities) {
|
||||
if (uiCapabilities.graph.save) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('xpack.graph.badge.readOnly.text', {
|
||||
text: i18n.translate('xpack.graph.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('xpack.graph.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('xpack.graph.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save Graph workspaces',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register((i18n) => {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'graph',
|
||||
title: 'Graph',
|
||||
description: i18n('xpack.graph.pluginDescription', {
|
||||
description: i18n.translate('xpack.graph.pluginDescription', {
|
||||
defaultMessage: 'Surface and analyze relevant relationships in your Elasticsearch data.',
|
||||
}),
|
||||
icon: 'graphApp',
|
||||
|
|
|
@ -6,12 +6,14 @@
|
|||
|
||||
import rison from 'rison-node';
|
||||
|
||||
export const getOutlinkEncoders = i18n => [{
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export const getOutlinkEncoders = () => [{
|
||||
id: 'esq-rison-loose',
|
||||
title: i18n('xpack.graph.outlinkEncoders.esqRisonLooseTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.esqRisonLooseTitle', {
|
||||
defaultMessage: 'elasticsearch OR query (rison encoded)',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.esqRisonLooseDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.esqRisonLooseDescription', {
|
||||
defaultMessage: 'rison-encoded JSON, minimum_should_match=1, compatible with most Kibana URLs',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
@ -19,10 +21,10 @@ export const getOutlinkEncoders = i18n => [{
|
|||
}
|
||||
}, {
|
||||
id: 'esq-rison',
|
||||
title: i18n('xpack.graph.outlinkEncoders.esqRisonTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.esqRisonTitle', {
|
||||
defaultMessage: 'elasticsearch AND query (rison encoded)',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.esqRisonDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.esqRisonDescription', {
|
||||
defaultMessage: 'rison-encoded JSON, minimum_should_match=2, compatible with most Kibana URLs',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
@ -30,10 +32,10 @@ export const getOutlinkEncoders = i18n => [{
|
|||
}
|
||||
}, {
|
||||
id: 'esq-similar-rison',
|
||||
title: i18n('xpack.graph.outlinkEncoders.esqSimilarRisonTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.esqSimilarRisonTitle', {
|
||||
defaultMessage: 'elasticsearch more like this query (rison encoded)',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.esqSimilarRisonDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.esqSimilarRisonDescription', {
|
||||
defaultMessage: 'rison-encoded JSON, "like this but not this" type query to find missing docs',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
@ -41,10 +43,10 @@ export const getOutlinkEncoders = i18n => [{
|
|||
}
|
||||
}, {
|
||||
id: 'esq-plain',
|
||||
title: i18n('xpack.graph.outlinkEncoders.esqPlainTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.esqPlainTitle', {
|
||||
defaultMessage: 'elasticsearch query (plain encoding)',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.esqPlainDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.esqPlainDescription', {
|
||||
defaultMessage: 'JSON encoded using standard url encoding',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
@ -52,10 +54,10 @@ export const getOutlinkEncoders = i18n => [{
|
|||
}
|
||||
}, {
|
||||
id: 'text-plain',
|
||||
title: i18n('xpack.graph.outlinkEncoders.textPlainTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.textPlainTitle', {
|
||||
defaultMessage: 'plain text',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.textPlainDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.textPlainDescription', {
|
||||
defaultMessage: 'Text of selected vertex labels as a plain url-encoded string',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
@ -72,10 +74,10 @@ export const getOutlinkEncoders = i18n => [{
|
|||
}
|
||||
}, {
|
||||
id: 'text-lucene',
|
||||
title: i18n('xpack.graph.outlinkEncoders.textLuceneTitle', {
|
||||
title: i18n.translate('xpack.graph.outlinkEncoders.textLuceneTitle', {
|
||||
defaultMessage: 'Lucene-escaped text',
|
||||
}),
|
||||
description: i18n('xpack.graph.outlinkEncoders.textLuceneDescription', {
|
||||
description: i18n.translate('xpack.graph.outlinkEncoders.textLuceneDescription', {
|
||||
defaultMessage: 'Text of selected vertex labels with any Lucene special characters encoded',
|
||||
}),
|
||||
encode: function (workspace) {
|
||||
|
|
|
@ -8,16 +8,18 @@
|
|||
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'grokdebugger',
|
||||
title: i18n('xpack.grokDebugger.registryProviderTitle', {
|
||||
title: i18n.translate('xpack.grokDebugger.registryProviderTitle', {
|
||||
defaultMessage: '{grokLogParsingTool} Debugger',
|
||||
values: {
|
||||
grokLogParsingTool: 'Grok'
|
||||
}
|
||||
}),
|
||||
description: i18n('xpack.grokDebugger.registryProviderDescription', {
|
||||
description: i18n.translate('xpack.grokDebugger.registryProviderDescription', {
|
||||
defaultMessage: 'Simulate and debug {grokLogParsingTool} patterns for data transformation on ingestion.',
|
||||
values: {
|
||||
grokLogParsingTool: 'grok'
|
||||
|
|
|
@ -5,14 +5,15 @@
|
|||
*/
|
||||
|
||||
import { DevToolsRegistryProvider } from 'ui/registry/dev_tools';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { XPackInfoProvider } from 'plugins/xpack_main/services/xpack_info';
|
||||
|
||||
DevToolsRegistryProvider.register((Private, i18n) => {
|
||||
DevToolsRegistryProvider.register(Private => {
|
||||
const xpackInfo = Private(XPackInfoProvider);
|
||||
return {
|
||||
order: 6,
|
||||
name: 'grokdebugger',
|
||||
display: i18n('xpack.grokDebugger.displayName', {
|
||||
display: i18n.translate('xpack.grokDebugger.displayName', {
|
||||
defaultMessage: 'Grok Debugger',
|
||||
}),
|
||||
url: '#/dev_tools/grokdebugger',
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(($injector, i18n) => {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register($injector => {
|
||||
|
||||
const licenseService = $injector.get('logstashLicenseService');
|
||||
if (!licenseService.enableLinks) {
|
||||
|
@ -15,10 +17,10 @@ FeatureCatalogueRegistryProvider.register(($injector, i18n) => {
|
|||
|
||||
return {
|
||||
id: 'management_logstash',
|
||||
title: i18n('xpack.logstash.homeFeature.logstashPipelinesTitle', {
|
||||
title: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesTitle', {
|
||||
defaultMessage: 'Logstash Pipelines',
|
||||
}),
|
||||
description: i18n('xpack.logstash.homeFeature.logstashPipelinesDescription', {
|
||||
description: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesDescription', {
|
||||
defaultMessage: 'Create, delete, update, and clone data ingestion pipelines.',
|
||||
}),
|
||||
icon: 'pipelineApp',
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
import './kibana_services';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
// import the uiExports that we want to "use"
|
||||
import 'uiExports/autocompleteProviders';
|
||||
import 'uiExports/fieldFormats';
|
||||
|
@ -44,16 +46,16 @@ routes.enable();
|
|||
|
||||
routes
|
||||
.defaults(/.*/, {
|
||||
badge: (i18n, uiCapabilities) => {
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.maps.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n('xpack.maps.badge.readOnly.text', {
|
||||
text: i18n.translate('xpack.maps.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n('xpack.maps.badge.readOnly.tooltip', {
|
||||
tooltip: i18n.translate('xpack.maps.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save maps',
|
||||
}),
|
||||
iconType: 'glasses'
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.controller('MlConfirmModal', function ($scope, $modalInstance, params, i18n) {
|
||||
module.controller('MlConfirmModal', function ($scope, $modalInstance, params) {
|
||||
|
||||
$scope.okFunc = params.ok;
|
||||
$scope.cancelFunc = params.cancel;
|
||||
|
@ -17,11 +18,11 @@ module.controller('MlConfirmModal', function ($scope, $modalInstance, params, i1
|
|||
$scope.message = params.message || '';
|
||||
$scope.title = params.title || '';
|
||||
|
||||
$scope.okLabel = params.okLabel || i18n('xpack.ml.confirmModal.okButtonLabel', {
|
||||
$scope.okLabel = params.okLabel || i18n.translate('xpack.ml.confirmModal.okButtonLabel', {
|
||||
defaultMessage: 'OK',
|
||||
});
|
||||
|
||||
$scope.cancelLabel = params.cancelLabel || i18n('xpack.ml.confirmModal.cancelButtonLabel', {
|
||||
$scope.cancelLabel = params.cancelLabel || i18n.translate('xpack.ml.confirmModal.cancelButtonLabel', {
|
||||
defaultMessage: 'Cancel',
|
||||
});
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import d3 from 'd3';
|
||||
import moment from 'moment';
|
||||
|
||||
|
@ -26,7 +27,7 @@ import { uiModules } from 'ui/modules';
|
|||
import { timefilter } from 'ui/timefilter';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlDocumentCountChart', function (Private, i18n) {
|
||||
module.directive('mlDocumentCountChart', function (Private) {
|
||||
function link(scope, element, attrs) {
|
||||
const svgWidth = attrs.width ? +attrs.width : 400;
|
||||
const svgHeight = scope.height = attrs.height ? +attrs.height : 400;
|
||||
|
@ -157,7 +158,7 @@ module.directive('mlDocumentCountChart', function (Private, i18n) {
|
|||
|
||||
function showChartTooltip(data, rect) {
|
||||
const formattedDate = formatHumanReadableDateTime(data.time);
|
||||
const contents = i18n('xpack.ml.fieldDataCard.documentCountChart.chartTooltip', {
|
||||
const contents = i18n.translate('xpack.ml.fieldDataCard.documentCountChart.chartTooltip', {
|
||||
defaultMessage: '{formattedDate}{br}{hr}count: {dataValue}',
|
||||
values: {
|
||||
formattedDate,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import d3 from 'd3';
|
||||
|
||||
import { numTicks } from '../../util/chart_utils';
|
||||
|
@ -21,7 +22,7 @@ import { mlChartTooltipService } from '../../components/chart_tooltip/chart_tool
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlMetricDistributionChart', function (i18n) {
|
||||
module.directive('mlMetricDistributionChart', function () {
|
||||
|
||||
function link(scope, element, attrs) {
|
||||
const svgWidth = attrs.width ? +attrs.width : 400;
|
||||
|
@ -179,7 +180,7 @@ module.directive('mlMetricDistributionChart', function (i18n) {
|
|||
.attr('y', 10)
|
||||
.attr('class', 'info-text')
|
||||
.attr('transform', `translate(${margin.left}, ${margin.top})`)
|
||||
.text(i18n('xpack.ml.fieldDataCard.metricDistributionChart.displayingPercentilesLabel', {
|
||||
.text(i18n.translate('xpack.ml.fieldDataCard.metricDistributionChart.displayingPercentilesLabel', {
|
||||
defaultMessage: 'Displaying {minPercent} - {maxPercent} percentiles',
|
||||
values: {
|
||||
minPercent,
|
||||
|
@ -256,7 +257,7 @@ module.directive('mlMetricDistributionChart', function (i18n) {
|
|||
const minValFormatted = scope.card.fieldFormat.convert(bar.dataMin, 'text');
|
||||
if (bar.dataMax > bar.dataMin) {
|
||||
const maxValFormatted = scope.card.fieldFormat.convert(bar.dataMax, 'text');
|
||||
contents = i18n('xpack.ml.fieldDataCard.metricDistributionChart.documentsBarPercentBetweenValuesDescription', {
|
||||
contents = i18n.translate('xpack.ml.fieldDataCard.metricDistributionChart.documentsBarPercentBetweenValuesDescription', {
|
||||
defaultMessage: '{barPercent}% of documents have{br}values between {minValFormatted} and {maxValFormatted}',
|
||||
values: {
|
||||
barPercent: bar.percent,
|
||||
|
@ -266,7 +267,7 @@ module.directive('mlMetricDistributionChart', function (i18n) {
|
|||
},
|
||||
});
|
||||
} else {
|
||||
contents = i18n('xpack.ml.fieldDataCard.metricDistributionChart.documentsBarPercentValueDescription', {
|
||||
contents = i18n.translate('xpack.ml.fieldDataCard.metricDistributionChart.documentsBarPercentValueDescription', {
|
||||
defaultMessage: '{barPercent}% of documents have{br}a value of {minValFormatted}',
|
||||
values: {
|
||||
barPercent: bar.percent,
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
import template from './form_filter_input.html';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import angular from 'angular';
|
||||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlFormFilterInput', function (i18n) {
|
||||
module.directive('mlFormFilterInput', function () {
|
||||
return {
|
||||
scope: {
|
||||
placeholder: '@?',
|
||||
|
@ -29,11 +31,11 @@ module.directive('mlFormFilterInput', function (i18n) {
|
|||
|
||||
scope.placeholder = placeholderIsDefined
|
||||
? scope.placeholder
|
||||
: i18n('xpack.ml.formFilterInput.filterPlaceholder', { defaultMessage: 'Filter' });
|
||||
: i18n.translate('xpack.ml.formFilterInput.filterPlaceholder', { defaultMessage: 'Filter' });
|
||||
|
||||
scope.ariaLabel = placeholderIsDefined
|
||||
? scope.placeholder
|
||||
: i18n('xpack.ml.formFilterInput.filterAriaLabel', { defaultMessage: 'Filter' });
|
||||
: i18n.translate('xpack.ml.formFilterInput.filterAriaLabel', { defaultMessage: 'Filter' });
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import template from './job_group_select.html';
|
||||
|
||||
import { mlJobService } from 'plugins/ml/services/job_service';
|
||||
|
@ -16,7 +18,7 @@ import { InitAfterBindingsWorkaround } from 'ui/compat';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlJobGroupSelect', function (i18n) {
|
||||
module.directive('mlJobGroupSelect', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template,
|
||||
|
@ -33,7 +35,7 @@ module.directive('mlJobGroupSelect', function (i18n) {
|
|||
this.$scope = $scope;
|
||||
this.selectedGroups = [];
|
||||
this.groups = [];
|
||||
this.$scope.newGroupLabel = i18n('xpack.ml.jobGroupSelect.newGroupLabel', { defaultMessage: '(new group)' });
|
||||
this.$scope.newGroupLabel = i18n.translate('xpack.ml.jobGroupSelect.newGroupLabel', { defaultMessage: '(new group)' });
|
||||
|
||||
// load the jobs, in case they've not been loaded before
|
||||
// in order to get the job groups
|
||||
|
@ -112,7 +114,7 @@ module.directive('mlJobGroupSelect', function (i18n) {
|
|||
|
||||
groupTypes(group) {
|
||||
if(group.isTag === false) {
|
||||
return i18n('xpack.ml.jobGroupSelect.existingGroupsLabel', { defaultMessage: 'Existing groups' });
|
||||
return i18n.translate('xpack.ml.jobGroupSelect.existingGroupsLabel', { defaultMessage: 'Existing groups' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import $ from 'jquery';
|
||||
import moment from 'moment';
|
||||
import d3 from 'd3';
|
||||
|
@ -31,7 +32,7 @@ module.directive('mlJobSelectList', function (Private) {
|
|||
replace: true,
|
||||
transclude: true,
|
||||
template,
|
||||
controller: function ($scope, i18n) {
|
||||
controller: function ($scope) {
|
||||
const mlJobSelectService = Private(JobSelectServiceProvider);
|
||||
$scope.jobs = [];
|
||||
$scope.groups = [];
|
||||
|
@ -209,7 +210,7 @@ module.directive('mlJobSelectList', function (Private) {
|
|||
|
||||
const fromString = timeRange.fromMoment.format('MMM Do YYYY, HH:mm');
|
||||
const toString = timeRange.toMoment.format('MMM Do YYYY, HH:mm');
|
||||
timeRange.label = i18n('xpack.ml.jobSelectList.groupTimeRangeLabel', {
|
||||
timeRange.label = i18n.translate('xpack.ml.jobSelectList.groupTimeRangeLabel', {
|
||||
defaultMessage: '{fromString} to {toString}',
|
||||
values: {
|
||||
fromString,
|
||||
|
@ -363,7 +364,7 @@ module.directive('mlJobSelectList', function (Private) {
|
|||
|
||||
const fromString = job.timeRange.fromMoment.format('MMM Do YYYY, HH:mm');
|
||||
const toString = job.timeRange.toMoment.format('MMM Do YYYY, HH:mm');
|
||||
job.timeRange.label = i18n('xpack.ml.jobSelectList.jobTimeRangeLabel', {
|
||||
job.timeRange.label = i18n.translate('xpack.ml.jobSelectList.jobTimeRangeLabel', {
|
||||
defaultMessage: '{fromString} to {toString}',
|
||||
values: {
|
||||
fromString,
|
||||
|
|
|
@ -9,13 +9,14 @@
|
|||
// Service with functions used for broadcasting job picker changes
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { toastNotifications } from 'ui/notify';
|
||||
|
||||
import { mlJobService } from 'plugins/ml/services/job_service';
|
||||
|
||||
let jobSelectService = undefined;
|
||||
|
||||
export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
||||
export function JobSelectServiceProvider($rootScope, globalState) {
|
||||
|
||||
function checkGlobalState() {
|
||||
if (globalState.ml === undefined) {
|
||||
|
@ -42,7 +43,7 @@ export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
|||
|
||||
// if there are no valid ids, warn and then select the first job
|
||||
if (validIds.length === 0) {
|
||||
toastNotifications.addWarning(i18n('xpack.ml.jobSelect.noJobsSelectedWarningMessage', {
|
||||
toastNotifications.addWarning(i18n.translate('xpack.ml.jobSelect.noJobsSelectedWarningMessage', {
|
||||
defaultMessage: 'No jobs selected, auto selecting first job',
|
||||
}));
|
||||
|
||||
|
@ -90,7 +91,7 @@ export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
|||
|
||||
function warnAboutInvalidJobIds(invalidIds) {
|
||||
if (invalidIds.length > 0) {
|
||||
toastNotifications.addWarning(i18n('xpack.ml.jobSelect.requestedJobsDoesNotExistWarningMessage', {
|
||||
toastNotifications.addWarning(i18n.translate('xpack.ml.jobSelect.requestedJobsDoesNotExistWarningMessage', {
|
||||
defaultMessage: `Requested
|
||||
{invalidIdsLength, plural, one {job {invalidIds} does not exist} other {jobs {invalidIds} do not exist}}`,
|
||||
values: {
|
||||
|
@ -131,7 +132,7 @@ export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
|||
});
|
||||
// All jobs have been selected
|
||||
if ((_.uniq(selectedGroupJobs).length + groupLessJobs) === jobCount) {
|
||||
txt = i18n('xpack.ml.jobSelect.allJobsDescription', {
|
||||
txt = i18n.translate('xpack.ml.jobSelect.allJobsDescription', {
|
||||
defaultMessage: 'All jobs',
|
||||
});
|
||||
} else {
|
||||
|
@ -156,7 +157,7 @@ export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
|||
txt = wholeGroups[0];
|
||||
if (wholeGroups.length > 1 || groupLessJobs > 0) {
|
||||
const total = (wholeGroups.length - 1) + groupLessJobs;
|
||||
txt = i18n('xpack.ml.jobSelect.wholeGroupDescription', {
|
||||
txt = i18n.translate('xpack.ml.jobSelect.wholeGroupDescription', {
|
||||
defaultMessage: `{wholeGroup} (with {count, plural, zero {# job} one {# job} other {# jobs}}) and
|
||||
{total, plural, zero {# other} one {# other} other {# others}}`,
|
||||
values: {
|
||||
|
@ -170,7 +171,7 @@ export function JobSelectServiceProvider($rootScope, globalState, i18n) {
|
|||
// otherwise just list the job ids
|
||||
txt = splitJobId(jobs[0]).job;
|
||||
if (jobs.length > 1) {
|
||||
txt = i18n('xpack.ml.jobSelect.jobDescription', {
|
||||
txt = i18n.translate('xpack.ml.jobSelect.jobDescription', {
|
||||
defaultMessage: '{jobId} and {jobsAmount, plural, zero {# other} one {# other} other {# others}}',
|
||||
values: {
|
||||
jobId: splitJobId(jobs[0]).job,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import rison from 'rison-node';
|
||||
|
||||
import 'plugins/ml/components/form_filter_input';
|
||||
|
@ -51,14 +52,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlDataVisualizerViewFields', function (
|
||||
$scope,
|
||||
$timeout,
|
||||
$window,
|
||||
Private,
|
||||
AppState,
|
||||
config,
|
||||
i18n) {
|
||||
.controller('MlDataVisualizerViewFields', function ($scope, $timeout, $window, Private, AppState, config) {
|
||||
|
||||
timefilter.enableTimeRangeSelector();
|
||||
timefilter.enableAutoRefreshSelector();
|
||||
|
@ -112,13 +106,13 @@ module
|
|||
$scope.searchQueryText = _.get(queryBarQry, 'query', '');
|
||||
} else {
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('xpack.ml.datavisualizer.languageSyntaxNotSupportedWarningTitle', {
|
||||
title: i18n.translate('xpack.ml.datavisualizer.languageSyntaxNotSupportedWarningTitle', {
|
||||
defaultMessage: '{language} syntax not supported',
|
||||
values: {
|
||||
language: (queryBarQry.language !== undefined) ? queryBarQry.language : '',
|
||||
}
|
||||
}),
|
||||
text: i18n('xpack.ml.datavisualizer.languageSyntaxNotSupportedWarningDescription', {
|
||||
text: i18n.translate('xpack.ml.datavisualizer.languageSyntaxNotSupportedWarningDescription', {
|
||||
defaultMessage: 'The Data Visualizer currently only supports queries using the lucene query syntax.',
|
||||
}),
|
||||
});
|
||||
|
@ -513,7 +507,7 @@ module
|
|||
console.log('DataVisualizer - error getting stats for metric cards from elasticsearch:', err);
|
||||
if (err.statusCode === 500) {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.metricInternalServerErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.metricInternalServerErrorTitle', {
|
||||
defaultMessage: 'Error loading data for metrics in index {index}. {message}. ' +
|
||||
'The request may have timed out. Try using a smaller sample size or narrowing the time range.',
|
||||
values: {
|
||||
|
@ -525,7 +519,7 @@ module
|
|||
);
|
||||
} else {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.loadingMetricDataErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.loadingMetricDataErrorTitle', {
|
||||
defaultMessage: 'Error loading data for metrics in index {index}. {message}',
|
||||
values: {
|
||||
index: indexPattern.title,
|
||||
|
@ -583,7 +577,7 @@ module
|
|||
console.log('DataVisualizer - error getting non metric field stats from elasticsearch:', err);
|
||||
if (err.statusCode === 500) {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.fieldsInternalServerErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.fieldsInternalServerErrorTitle', {
|
||||
defaultMessage: 'Error loading data for fields in index {index}. {message}. ' +
|
||||
'The request may have timed out. Try using a smaller sample size or narrowing the time range.',
|
||||
values: {
|
||||
|
@ -595,7 +589,7 @@ module
|
|||
);
|
||||
} else {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.loadingFieldsDataErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.loadingFieldsDataErrorTitle', {
|
||||
defaultMessage: 'Error loading data for fields in index {index}. {message}',
|
||||
values: {
|
||||
index: indexPattern.title,
|
||||
|
@ -652,7 +646,7 @@ module
|
|||
console.log('DataVisualizer - error getting overall stats from elasticsearch:', err);
|
||||
if (err.statusCode === 500) {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.overallFieldsInternalServerErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.overallFieldsInternalServerErrorTitle', {
|
||||
defaultMessage: 'Error loading data for fields in index {index}. {message}. ' +
|
||||
'The request may have timed out. Try using a smaller sample size or narrowing the time range.',
|
||||
values: {
|
||||
|
@ -664,7 +658,7 @@ module
|
|||
);
|
||||
} else {
|
||||
notify.error(
|
||||
i18n('xpack.ml.datavisualizer.loadingOverallFieldsDataErrorTitle', {
|
||||
i18n.translate('xpack.ml.datavisualizer.loadingOverallFieldsDataErrorTitle', {
|
||||
defaultMessage: 'Error loading data for fields in index {index}. {message}',
|
||||
values: {
|
||||
index: indexPattern.title,
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
|
||||
import { mlMessageBarService } from 'plugins/ml/components/messagebar/messagebar_service';
|
||||
|
@ -14,10 +15,10 @@ import { mlMessageBarService } from 'plugins/ml/components/messagebar/messagebar
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.controller('MlDetectorFilterModal', function ($scope, $modalInstance, params, i18n) {
|
||||
module.controller('MlDetectorFilterModal', function ($scope, $modalInstance, params) {
|
||||
const msgs = mlMessageBarService;
|
||||
msgs.clear();
|
||||
$scope.title = i18n('xpack.ml.newJob.advanced.detectorFilterModal.addNewFilterTitle', {
|
||||
$scope.title = i18n.translate('xpack.ml.newJob.advanced.detectorFilterModal.addNewFilterTitle', {
|
||||
defaultMessage: 'Add new filter'
|
||||
});
|
||||
$scope.detector = params.detector;
|
||||
|
@ -27,10 +28,10 @@ module.controller('MlDetectorFilterModal', function ($scope, $modalInstance, par
|
|||
const add = params.add;
|
||||
const validate = params.validate;
|
||||
|
||||
$scope.updateButtonLabel = i18n('xpack.ml.newJob.advanced.detectorFilterModal.updateButtonLabel', {
|
||||
$scope.updateButtonLabel = i18n.translate('xpack.ml.newJob.advanced.detectorFilterModal.updateButtonLabel', {
|
||||
defaultMessage: 'Update'
|
||||
});
|
||||
$scope.addButtonLabel = i18n('xpack.ml.newJob.advanced.detectorFilterModal.addButtonLabel', {
|
||||
$scope.addButtonLabel = i18n.translate('xpack.ml.newJob.advanced.detectorFilterModal.addButtonLabel', {
|
||||
defaultMessage: 'Add'
|
||||
});
|
||||
|
||||
|
@ -99,7 +100,7 @@ module.controller('MlDetectorFilterModal', function ($scope, $modalInstance, par
|
|||
// editing an existing filter
|
||||
$scope.editMode = true;
|
||||
$scope.filter = params.filter;
|
||||
$scope.title = i18n('xpack.ml.newJob.advanced.detectorFilterModal.editFilterTitle', {
|
||||
$scope.title = i18n.translate('xpack.ml.newJob.advanced.detectorFilterModal.editFilterTitle', {
|
||||
defaultMessage: 'Edit filter'
|
||||
});
|
||||
index = params.index;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
import { detectorToString } from 'plugins/ml/util/string_utils';
|
||||
import { mlMessageBarService } from 'plugins/ml/components/messagebar/messagebar_service';
|
||||
|
@ -14,10 +15,10 @@ import { mlMessageBarService } from 'plugins/ml/components/messagebar/messagebar
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.controller('MlDetectorModal', function ($scope, $modalInstance, params, i18n) {
|
||||
module.controller('MlDetectorModal', function ($scope, $modalInstance, params) {
|
||||
const msgs = mlMessageBarService;
|
||||
msgs.clear();
|
||||
$scope.title = i18n('xpack.ml.newJob.advanced.detectorModal.addNewDetectorTitle', {
|
||||
$scope.title = i18n.translate('xpack.ml.newJob.advanced.detectorModal.addNewDetectorTitle', {
|
||||
defaultMessage: 'Add new detector'
|
||||
});
|
||||
$scope.detector = { 'function': '' };
|
||||
|
@ -25,10 +26,10 @@ module.controller('MlDetectorModal', function ($scope, $modalInstance, params, i
|
|||
$scope.editMode = false;
|
||||
let index = -1;
|
||||
|
||||
$scope.updateButtonLabel = i18n('xpack.ml.newJob.advanced.detectorModal.updateButtonLabel', {
|
||||
$scope.updateButtonLabel = i18n.translate('xpack.ml.newJob.advanced.detectorModal.updateButtonLabel', {
|
||||
defaultMessage: 'Update'
|
||||
});
|
||||
$scope.addButtonLabel = i18n('xpack.ml.newJob.advanced.detectorModal.addButtonLabel', {
|
||||
$scope.addButtonLabel = i18n.translate('xpack.ml.newJob.advanced.detectorModal.addButtonLabel', {
|
||||
defaultMessage: 'Add'
|
||||
});
|
||||
|
||||
|
@ -90,7 +91,7 @@ module.controller('MlDetectorModal', function ($scope, $modalInstance, params, i
|
|||
if (params.detector) {
|
||||
$scope.detector = params.detector;
|
||||
index = params.index;
|
||||
$scope.title = i18n('xpack.ml.newJob.advanced.detectorModal.editDetectorTitle', {
|
||||
$scope.title = i18n.translate('xpack.ml.newJob.advanced.detectorModal.editDetectorTitle', {
|
||||
defaultMessage: 'Edit detector'
|
||||
});
|
||||
$scope.editMode = true;
|
||||
|
@ -102,14 +103,14 @@ module.controller('MlDetectorModal', function ($scope, $modalInstance, params, i
|
|||
|
||||
$scope.functionChange = function () {
|
||||
const func = _.findWhere($scope.functions, { id: $scope.detector.function });
|
||||
$scope.helpLink.label = i18n('xpack.ml.newJob.advanced.detectorModal.helpForAnalyticalFunctionsLabel', {
|
||||
$scope.helpLink.label = i18n.translate('xpack.ml.newJob.advanced.detectorModal.helpForAnalyticalFunctionsLabel', {
|
||||
defaultMessage: 'Help for analytical functions'
|
||||
});
|
||||
$scope.helpLink.uri = 'ml-functions.html';
|
||||
|
||||
if (func) {
|
||||
$scope.helpLink.uri = func.uri;
|
||||
$scope.helpLink.label = i18n('xpack.ml.newJob.advanced.detectorModal.helpForAnalyticalFunctionLabel', {
|
||||
$scope.helpLink.label = i18n.translate('xpack.ml.newJob.advanced.detectorModal.helpForAnalyticalFunctionLabel', {
|
||||
defaultMessage: 'Help for {funcId}',
|
||||
values: { funcId: func.id }
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// directive for displaying detectors form list.
|
||||
|
||||
import angular from 'angular';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import _ from 'lodash';
|
||||
import 'plugins/ml/jobs/new_job/advanced/detector_modal';
|
||||
import 'plugins/ml/jobs/new_job/advanced/detector_filter_modal';
|
||||
|
@ -21,7 +22,7 @@ import { mlJobService } from 'plugins/ml/services/job_service';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlJobDetectorsList', function ($modal, i18n) {
|
||||
module.directive('mlJobDetectorsList', function ($modal) {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
replace: true,
|
||||
|
@ -97,7 +98,7 @@ module.directive('mlJobDetectorsList', function ($modal, i18n) {
|
|||
then: function (callback) {
|
||||
callback({
|
||||
success: false,
|
||||
message: i18n('xpack.ml.newJob.advanced.detectorsList.invalidExcludeFrequentParameterErrorMessage', {
|
||||
message: i18n.translate('xpack.ml.newJob.advanced.detectorsList.invalidExcludeFrequentParameterErrorMessage', {
|
||||
defaultMessage: '{excludeFrequentParam} value must be: {allValue}, {noneValue}, {byValue} or {overValue}',
|
||||
values: {
|
||||
excludeFrequentParam: 'exclude_frequent',
|
||||
|
@ -124,7 +125,7 @@ module.directive('mlJobDetectorsList', function ($modal, i18n) {
|
|||
return {
|
||||
success: false,
|
||||
message: (
|
||||
resp.message || i18n('xpack.ml.newJob.advanced.detectorsList.validationFailedErrorMessage', {
|
||||
resp.message || i18n.translate('xpack.ml.newJob.advanced.detectorsList.validationFailedErrorMessage', {
|
||||
defaultMessage: 'Validation failed'
|
||||
})
|
||||
)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
import 'ace';
|
||||
import 'ui/angular_ui_select';
|
||||
|
@ -73,14 +74,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.controller('MlNewJob',
|
||||
function (
|
||||
$scope,
|
||||
$route,
|
||||
$location,
|
||||
$modal,
|
||||
Private,
|
||||
mlConfirmModalService,
|
||||
i18n) {
|
||||
function ($scope, $route, $location, $modal, Private, mlConfirmModalService) {
|
||||
|
||||
timefilter.disableTimeRangeSelector(); // remove time picker from top of page
|
||||
timefilter.disableAutoRefreshSelector(); // remove time picker from top of page
|
||||
|
@ -137,53 +131,58 @@ module.controller('MlNewJob',
|
|||
$scope.elasticServerInfo = {};
|
||||
$scope.jobGroupsUpdateFunction = {};
|
||||
|
||||
$scope.enterJobNameLabel = i18n('xpack.ml.newJob.advanced.jobDetails.enterJobNameLabel', {
|
||||
$scope.enterJobNameLabel = i18n.translate('xpack.ml.newJob.advanced.jobDetails.enterJobNameLabel', {
|
||||
defaultMessage: 'Enter a name for the job'
|
||||
});
|
||||
$scope.bucketSpanNotValidFormatLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.bucketSpanNotValidFormatLabel', {
|
||||
$scope.bucketSpanNotValidFormatLabel = i18n.translate('xpack.ml.newJob.advanced.analysisConfiguration.bucketSpanNotValidFormatLabel', {
|
||||
defaultMessage: '{bucketSpan} is not a valid time interval format',
|
||||
values: { bucketSpan: 'bucket_span' }
|
||||
});
|
||||
$scope.categorizationFiltersNotValidLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.categorizationFiltersNotValidLabel', {
|
||||
defaultMessage: 'Categorization filters must all be valid regular expressions'
|
||||
});
|
||||
$scope.detectorNotConfiguredLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.detectorNotConfiguredLabel', {
|
||||
$scope.categorizationFiltersNotValidLabel = i18n.translate(
|
||||
'xpack.ml.newJob.advanced.analysisConfiguration.categorizationFiltersNotValidLabel', {
|
||||
defaultMessage: 'Categorization filters must all be valid regular expressions'
|
||||
});
|
||||
$scope.detectorNotConfiguredLabel = i18n.translate('xpack.ml.newJob.advanced.analysisConfiguration.detectorNotConfiguredLabel', {
|
||||
defaultMessage: 'At least one detector should be configured'
|
||||
});
|
||||
$scope.influencerNotSelectedLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.influencerNotSelectedLabel', {
|
||||
$scope.influencerNotSelectedLabel = i18n.translate('xpack.ml.newJob.advanced.analysisConfiguration.influencerNotSelectedLabel', {
|
||||
defaultMessage: 'At least one influencer should be selected'
|
||||
});
|
||||
$scope.validatingCardinalityLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.validatingCardinalityLabel', {
|
||||
$scope.validatingCardinalityLabel = i18n.translate('xpack.ml.newJob.advanced.analysisConfiguration.validatingCardinalityLabel', {
|
||||
defaultMessage: 'Validating cardinality…'
|
||||
});
|
||||
$scope.enableModelPlotLabel = i18n('xpack.ml.newJob.advanced.analysisConfiguration.enableModelPlotLabel', {
|
||||
$scope.enableModelPlotLabel = i18n.translate('xpack.ml.newJob.advanced.analysisConfiguration.enableModelPlotLabel', {
|
||||
defaultMessage: 'Enable model plot'
|
||||
});
|
||||
$scope.specifyTimeFieldLabel = i18n('xpack.ml.newJob.advanced.dataDescription.specifyTimeFieldLabel', {
|
||||
$scope.specifyTimeFieldLabel = i18n.translate('xpack.ml.newJob.advanced.dataDescription.specifyTimeFieldLabel', {
|
||||
defaultMessage: 'Time field should be specified'
|
||||
});
|
||||
$scope.specifyTimeFormatLabel = i18n('xpack.ml.newJob.advanced.dataDescription.specifyTimeFormatLabel', {
|
||||
$scope.specifyTimeFormatLabel = i18n.translate('xpack.ml.newJob.advanced.dataDescription.specifyTimeFormatLabel', {
|
||||
defaultMessage: 'Time format should be specified'
|
||||
});
|
||||
|
||||
$scope.ui = {
|
||||
pageTitle: i18n('xpack.ml.newJob.advanced.createNewJobTitle', {
|
||||
pageTitle: i18n.translate('xpack.ml.newJob.advanced.createNewJobTitle', {
|
||||
defaultMessage: 'Create a new job'
|
||||
}),
|
||||
dataLocation: 'ES',
|
||||
dataPreview: '',
|
||||
currentTab: 0,
|
||||
tabs: [
|
||||
{ index: 0, title: i18n('xpack.ml.newJob.advanced.tabs.jobDetailsLabel', { defaultMessage: 'Job Details' }) },
|
||||
{ index: 1, title: i18n('xpack.ml.newJob.advanced.tabs.analysisConfigurationLabel', { defaultMessage: 'Analysis Configuration' }) },
|
||||
{ index: 0, title: i18n.translate(
|
||||
'xpack.ml.newJob.advanced.tabs.jobDetailsLabel', { defaultMessage: 'Job Details' }) },
|
||||
{ index: 1, title: i18n.translate(
|
||||
'xpack.ml.newJob.advanced.tabs.analysisConfigurationLabel', { defaultMessage: 'Analysis Configuration' }) },
|
||||
{
|
||||
index: 2,
|
||||
title: i18n('xpack.ml.newJob.advanced.tabs.dataDescriptionLabel', { defaultMessage: 'Data Description' }),
|
||||
title: i18n.translate('xpack.ml.newJob.advanced.tabs.dataDescriptionLabel', { defaultMessage: 'Data Description' }),
|
||||
hidden: true
|
||||
},
|
||||
{ index: 3, title: i18n('xpack.ml.newJob.advanced.tabs.datafeedLabel', { defaultMessage: 'Datafeed' }) },
|
||||
{ index: 4, title: i18n('xpack.ml.newJob.advanced.tabs.editJsonLabel', { defaultMessage: 'Edit JSON' }) },
|
||||
{ index: 5, title: i18n('xpack.ml.newJob.advanced.tabs.dataPreviewLabel', { defaultMessage: 'Data Preview' }), hidden: true },
|
||||
{ index: 3, title: i18n.translate(
|
||||
'xpack.ml.newJob.advanced.tabs.datafeedLabel', { defaultMessage: 'Datafeed' }) },
|
||||
{ index: 4, title: i18n.translate('xpack.ml.newJob.advanced.tabs.editJsonLabel', { defaultMessage: 'Edit JSON' }) },
|
||||
{ index: 5, title: i18n.translate(
|
||||
'xpack.ml.newJob.advanced.tabs.dataPreviewLabel', { defaultMessage: 'Data Preview' }), hidden: true },
|
||||
],
|
||||
validation: {
|
||||
tabs: [
|
||||
|
@ -216,15 +215,15 @@ module.controller('MlNewJob',
|
|||
customInfluencers: [],
|
||||
tempCustomInfluencer: '',
|
||||
inputDataFormat: [
|
||||
{ value: 'delimited', title: i18n('xpack.ml.newJob.advanced.delimitedLabel', { defaultMessage: 'Delimited' }) },
|
||||
{ value: 'delimited', title: i18n.translate('xpack.ml.newJob.advanced.delimitedLabel', { defaultMessage: 'Delimited' }) },
|
||||
{ value: 'json', title: 'JSON' },
|
||||
],
|
||||
fieldDelimiterOptions: [
|
||||
{ value: '\t', title: i18n('xpack.ml.newJob.advanced.tabLabel', { defaultMessage: 'tab' }) },
|
||||
{ value: ' ', title: i18n('xpack.ml.newJob.advanced.spaceLabel', { defaultMessage: 'space' }) },
|
||||
{ value: '\t', title: i18n.translate('xpack.ml.newJob.advanced.tabLabel', { defaultMessage: 'tab' }) },
|
||||
{ value: ' ', title: i18n.translate('xpack.ml.newJob.advanced.spaceLabel', { defaultMessage: 'space' }) },
|
||||
{ value: ',', title: ',' },
|
||||
{ value: ';', title: ';' },
|
||||
{ value: 'custom', title: i18n('xpack.ml.newJob.advanced.customLabel', { defaultMessage: 'custom' }) }
|
||||
{ value: 'custom', title: i18n.translate('xpack.ml.newJob.advanced.customLabel', { defaultMessage: 'custom' }) }
|
||||
],
|
||||
selectedFieldDelimiter: ',',
|
||||
customFieldDelimiter: '',
|
||||
|
@ -270,7 +269,7 @@ module.controller('MlNewJob',
|
|||
if (jobId) {
|
||||
$scope.mode = MODE.EDIT;
|
||||
console.log('Editing job', mlJobService.currentJob);
|
||||
$scope.ui.pageTitle = i18n('xpack.ml.newJob.advanced.editingJobPageTitle', {
|
||||
$scope.ui.pageTitle = i18n.translate('xpack.ml.newJob.advanced.editingJobPageTitle', {
|
||||
defaultMessage: 'Editing Job {jobId}',
|
||||
values: { jobId: $scope.job.job_id }
|
||||
});
|
||||
|
@ -288,7 +287,7 @@ module.controller('MlNewJob',
|
|||
} else {
|
||||
$scope.mode = MODE.CLONE;
|
||||
console.log('Cloning job', mlJobService.currentJob);
|
||||
$scope.ui.pageTitle = i18n('xpack.ml.newJob.advanced.cloneJobFromPageTitle', {
|
||||
$scope.ui.pageTitle = i18n.translate('xpack.ml.newJob.advanced.cloneJobFromPageTitle', {
|
||||
defaultMessage: 'Clone Job from {jobId}',
|
||||
values: { jobId: $scope.job.job_id }
|
||||
});
|
||||
|
@ -515,7 +514,7 @@ module.controller('MlNewJob',
|
|||
const tab = $scope.ui.validation.tabs[0];
|
||||
tab.valid = false;
|
||||
tab.checks.jobId.valid = false;
|
||||
tab.checks.jobId.message = i18n('xpack.ml.newJob.advanced.jobAlreadyExistsLabel', {
|
||||
tab.checks.jobId.message = i18n.translate('xpack.ml.newJob.advanced.jobAlreadyExistsLabel', {
|
||||
defaultMessage: `'{jobId}' already exists, please choose a different name`,
|
||||
values: { jobId: $scope.job.job_id }
|
||||
});
|
||||
|
@ -533,10 +532,10 @@ module.controller('MlNewJob',
|
|||
} else {
|
||||
// if there are no influencers set, open a confirmation
|
||||
mlConfirm.open({
|
||||
message: i18n('xpack.ml.newJob.advanced.noInfluencersChosenConfirmModalDescription', {
|
||||
message: i18n.translate('xpack.ml.newJob.advanced.noInfluencersChosenConfirmModalDescription', {
|
||||
defaultMessage: 'You have not chosen any influencers, do you want to continue?'
|
||||
}),
|
||||
title: i18n('xpack.ml.newJob.advanced.noInfluencersChosenConfirmModalTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.advanced.noInfluencersChosenConfirmModalTitle', {
|
||||
defaultMessage: 'No Influencers'
|
||||
})
|
||||
})
|
||||
|
@ -590,7 +589,7 @@ module.controller('MlNewJob',
|
|||
// console.log('refreshed fields for index pattern .ml-anomalies-*');
|
||||
// wait for mappings refresh before continuing on with the post save stuff
|
||||
msgs.info(
|
||||
i18n('xpack.ml.newJob.advanced.newJobAddedNotificationMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.newJobAddedNotificationMessage', {
|
||||
defaultMessage: `New Job '{jobId}' added`,
|
||||
values: { jobId: result.resp.job_id }
|
||||
})
|
||||
|
@ -606,13 +605,13 @@ module.controller('MlNewJob',
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.couldNotOpenJobErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.couldNotOpenJobErrorMessage', {
|
||||
defaultMessage: 'Could not open job:'
|
||||
}),
|
||||
resp
|
||||
);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.jobCreatedAndCreatingDatafeedAnywayErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.jobCreatedAndCreatingDatafeedAnywayErrorMessage', {
|
||||
defaultMessage: 'Job created, creating datafeed anyway'
|
||||
})
|
||||
);
|
||||
|
@ -629,7 +628,7 @@ module.controller('MlNewJob',
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.couldNotCreateDatafeedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.couldNotCreateDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not create datafeed:'
|
||||
}),
|
||||
resp
|
||||
|
@ -653,7 +652,7 @@ module.controller('MlNewJob',
|
|||
$scope.ui.saveStatus.job = -1;
|
||||
$scope.saveLock = false;
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.unsuccessfulSavingResultErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.unsuccessfulSavingResultErrorMessage', {
|
||||
defaultMessage: 'Save failed: {message}',
|
||||
values: { message: result.resp.message }
|
||||
})
|
||||
|
@ -664,7 +663,7 @@ module.controller('MlNewJob',
|
|||
$scope.ui.saveStatus.job = -1;
|
||||
$scope.saveLock = false;
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.saveFailedWithMessageErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.saveFailedWithMessageErrorMessage', {
|
||||
defaultMessage: 'Save failed: {message}',
|
||||
values: { message: result.resp.message }
|
||||
})
|
||||
|
@ -675,7 +674,7 @@ module.controller('MlNewJob',
|
|||
})
|
||||
.catch(() => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.advanced.saveFailedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.advanced.saveFailedErrorMessage', {
|
||||
defaultMessage: 'Save failed'
|
||||
})
|
||||
);
|
||||
|
@ -692,10 +691,10 @@ module.controller('MlNewJob',
|
|||
|
||||
$scope.cancel = function () {
|
||||
mlConfirm.open({
|
||||
message: i18n('xpack.ml.newJob.advanced.cancelJobCreationConfirmModalDescription', {
|
||||
message: i18n.translate('xpack.ml.newJob.advanced.cancelJobCreationConfirmModalDescription', {
|
||||
defaultMessage: 'Are you sure you want to cancel job creation?'
|
||||
}),
|
||||
title: i18n('xpack.ml.newJob.advanced.cancelJobCreationConfirmModalTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.advanced.cancelJobCreationConfirmModalTitle', {
|
||||
defaultMessage: 'Are you sure?'
|
||||
})
|
||||
})
|
||||
|
@ -812,7 +811,7 @@ module.controller('MlNewJob',
|
|||
$scope.ui.cardinalityValidator.status = STATUS.FINISHED;
|
||||
$scope.ui.cardinalityValidator.message = '';
|
||||
} else {
|
||||
$scope.ui.cardinalityValidator.message = i18n(
|
||||
$scope.ui.cardinalityValidator.message = i18n.translate(
|
||||
'xpack.ml.newJob.advanced.recommendationForUsingModelPlotWithCardinalityDescription',
|
||||
{
|
||||
defaultMessage: 'Creating model plots is resource intensive and not recommended ' +
|
||||
|
@ -829,7 +828,7 @@ module.controller('MlNewJob',
|
|||
})
|
||||
.catch((error) => {
|
||||
console.log('Cardinality check error:', error);
|
||||
$scope.ui.cardinalityValidator.message = i18n(
|
||||
$scope.ui.cardinalityValidator.message = i18n.translate(
|
||||
'xpack.ml.newJob.advanced.cardinalityNotValidErrorMessage',
|
||||
{
|
||||
defaultMessage: 'An error occurred validating the configuration ' +
|
||||
|
@ -1218,7 +1217,7 @@ module.controller('MlNewJob',
|
|||
const validationResults = basicJobValidation($scope.job, $scope.fields, limits);
|
||||
|
||||
const valid = validationResults.valid;
|
||||
const message = i18n('xpack.ml.newJob.advanced.fillInAllrequiredFieldsValidationMessage', {
|
||||
const message = i18n.translate('xpack.ml.newJob.advanced.fillInAllrequiredFieldsValidationMessage', {
|
||||
defaultMessage: 'Fill in all required fields'
|
||||
});
|
||||
|
||||
|
@ -1243,7 +1242,7 @@ module.controller('MlNewJob',
|
|||
tabs[0].checks.jobId.valid = false;
|
||||
} else if (validationResults.contains('job_id_invalid')) {
|
||||
tabs[0].checks.jobId.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.jobNameAllowedCharactersDescription', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.jobNameAllowedCharactersDescription', {
|
||||
defaultMessage: 'Job name can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' +
|
||||
'must start and end with an alphanumeric character'
|
||||
});
|
||||
|
@ -1252,7 +1251,7 @@ module.controller('MlNewJob',
|
|||
|
||||
if (validationResults.contains('job_group_id_invalid')) {
|
||||
tabs[0].checks.groupIds.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.jobGroupNamesAllowedCharactersDescription', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.jobGroupNamesAllowedCharactersDescription', {
|
||||
defaultMessage: 'Job group names can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' +
|
||||
'must start and end with an alphanumeric character'
|
||||
});
|
||||
|
@ -1261,7 +1260,7 @@ module.controller('MlNewJob',
|
|||
|
||||
if (validationResults.contains('model_memory_limit_units_invalid')) {
|
||||
tabs[0].checks.modelMemoryLimit.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.modelMemoryLimitUnrecognizedUnitsErrorMessage', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.modelMemoryLimitUnrecognizedUnitsErrorMessage', {
|
||||
defaultMessage: 'Model memory limit data unit unrecognized. It must be {allowedDataUnits} or {allowedDataUnit}',
|
||||
values: {
|
||||
allowedDataUnits: (ALLOWED_DATA_UNITS.slice(0, ALLOWED_DATA_UNITS.length - 1).join(', ')),
|
||||
|
@ -1273,7 +1272,7 @@ module.controller('MlNewJob',
|
|||
|
||||
if (validationResults.contains('model_memory_limit_invalid')) {
|
||||
tabs[0].checks.modelMemoryLimit.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.modelMemoryLimitInvalidRangeErrorMessage', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.modelMemoryLimitInvalidRangeErrorMessage', {
|
||||
defaultMessage: 'Model memory limit cannot be higher than the maximum value of {maxModelMemoryLimit}',
|
||||
values: { maxModelMemoryLimit: limits.max_model_memory_limit.toUpperCase() }
|
||||
});
|
||||
|
@ -1282,10 +1281,11 @@ module.controller('MlNewJob',
|
|||
|
||||
// tab 1 - Analysis Configuration
|
||||
if (validationResults.contains('categorization_filter_invalid')) {
|
||||
tabs[1].checks.categorizationFilters.message = i18n('xpack.ml.newJob.advanced.validateJob.howToAllowFiltersDescription', {
|
||||
defaultMessage: '{categorizationFieldName} must be set to allow filters',
|
||||
values: { categorizationFieldName: 'categorizationFieldName' }
|
||||
});
|
||||
tabs[1].checks.categorizationFilters.message = i18n.translate(
|
||||
'xpack.ml.newJob.advanced.validateJob.howToAllowFiltersDescription', {
|
||||
defaultMessage: '{categorizationFieldName} must be set to allow filters',
|
||||
values: { categorizationFieldName: 'categorizationFieldName' }
|
||||
});
|
||||
tabs[1].checks.categorizationFilters.valid = false;
|
||||
}
|
||||
|
||||
|
@ -1293,7 +1293,7 @@ module.controller('MlNewJob',
|
|||
tabs[1].checks.detectors.valid = false;
|
||||
}
|
||||
if (validationResults.contains('detectors_duplicates')) {
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.duplicateDetectorsFoundErrorMessage', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.duplicateDetectorsFoundErrorMessage', {
|
||||
defaultMessage: 'Duplicate detectors were found. Detectors having the same combined configuration for ' +
|
||||
`'{function}', '{fieldName}', '{byFieldName}', '{overFieldName}' and '{partitionFieldName}' ` +
|
||||
'are not allowed within the same job.',
|
||||
|
@ -1314,13 +1314,13 @@ module.controller('MlNewJob',
|
|||
}
|
||||
|
||||
if (validationResults.contains('bucket_span_empty')) {
|
||||
tabs[1].checks.bucketSpan.message = i18n('xpack.ml.newJob.advanced.validateJob.bucketSpanMustBeSetErrorMessage', {
|
||||
tabs[1].checks.bucketSpan.message = i18n.translate('xpack.ml.newJob.advanced.validateJob.bucketSpanMustBeSetErrorMessage', {
|
||||
defaultMessage: '{bucketSpan} must be set',
|
||||
values: { bucketSpan: 'bucket_span' }
|
||||
});
|
||||
tabs[1].checks.bucketSpan.valid = false;
|
||||
} else if (validationResults.contains('bucket_span_invalid')) {
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.bucketSpanInvalidTimeIntervalFormatErrorMessage', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.bucketSpanInvalidTimeIntervalFormatErrorMessage', {
|
||||
defaultMessage:
|
||||
'{bucketSpan} is not a valid time interval format e.g. {tenMinutes}, {oneHour}. It also needs to be higher than zero.',
|
||||
values: { bucketSpan: job.analysis_config.bucket_span, tenMinutes: '10m', oneHour: '1h' }
|
||||
|
@ -1354,7 +1354,7 @@ module.controller('MlNewJob',
|
|||
// it can be overridden with a custom function to do an alternative test
|
||||
function validateIndex(tabs, dataFeedTest = () => (Object.keys($scope.fields).length === 0)) {
|
||||
if (dataFeedTest()) {
|
||||
const msg = i18n('xpack.ml.newJob.advanced.validateJob.couldNotLoadFieldsFromIndexErrorMessage', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.advanced.validateJob.couldNotLoadFieldsFromIndexErrorMessage', {
|
||||
defaultMessage: 'Could not load fields from index'
|
||||
});
|
||||
tabs[3].checks.hasAccessToIndex.valid = false;
|
||||
|
@ -1414,7 +1414,7 @@ module.controller('MlNewJob',
|
|||
$scope.$applyAsync();
|
||||
});
|
||||
} else {
|
||||
$scope.ui.dataPreview = i18n('xpack.ml.newJob.advanced.dataPreview.datafeedDoesNotExistLabel', {
|
||||
$scope.ui.dataPreview = i18n.translate('xpack.ml.newJob.advanced.dataPreview.datafeedDoesNotExistLabel', {
|
||||
defaultMessage: 'Datafeed does not exist'
|
||||
});
|
||||
$scope.$applyAsync();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { BucketSpanEstimator } from './bucket_span_estimator_view';
|
||||
|
@ -16,7 +17,7 @@ import { I18nContext } from 'ui/i18n';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlBucketSpanEstimator', function (i18n) {
|
||||
module.directive('mlBucketSpanEstimator', function () {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
replace: false,
|
||||
|
@ -39,9 +40,10 @@ module.directive('mlBucketSpanEstimator', function (i18n) {
|
|||
const errorHandler = (error) => {
|
||||
console.log('Bucket span could not be estimated', error);
|
||||
$scope.ui.bucketSpanEstimator.status = STATUS.FAILED;
|
||||
$scope.ui.bucketSpanEstimator.message = i18n('xpack.ml.newJob.simple.bucketSpanEstimator.bucketSpanCouldNotBeEstimatedMessage', {
|
||||
defaultMessage: 'Bucket span could not be estimated'
|
||||
});
|
||||
$scope.ui.bucketSpanEstimator.message = i18n.translate(
|
||||
'xpack.ml.newJob.simple.bucketSpanEstimator.bucketSpanCouldNotBeEstimatedMessage', {
|
||||
defaultMessage: 'Bucket span could not be estimated'
|
||||
});
|
||||
$scope.$applyAsync();
|
||||
};
|
||||
|
||||
|
@ -122,10 +124,10 @@ module.directive('mlBucketSpanEstimator', function (i18n) {
|
|||
);
|
||||
const estimatorRunning = ($scope.ui.bucketSpanEstimator.status === STATUS.RUNNING);
|
||||
const buttonText = (estimatorRunning)
|
||||
? i18n('xpack.ml.newJob.simple.bucketSpanEstimator.estimatingBucketSpanButtonLabel', {
|
||||
? i18n.translate('xpack.ml.newJob.simple.bucketSpanEstimator.estimatingBucketSpanButtonLabel', {
|
||||
defaultMessage: 'Estimating bucket span'
|
||||
})
|
||||
: i18n('xpack.ml.newJob.simple.bucketSpanEstimator.estimateBucketSpanButtonLabel', {
|
||||
: i18n.translate('xpack.ml.newJob.simple.bucketSpanEstimator.estimateBucketSpanButtonLabel', {
|
||||
defaultMessage: 'Estimate bucket span'
|
||||
});
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { EnableModelPlotCheckbox } from './enable_model_plot_checkbox_view.js';
|
||||
|
@ -16,7 +17,7 @@ import { I18nContext } from 'ui/i18n';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlEnableModelPlotCheckbox', function (i18n) {
|
||||
module.directive('mlEnableModelPlotCheckbox', function () {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
replace: false,
|
||||
|
@ -37,12 +38,13 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
|
|||
function errorHandler(error) {
|
||||
console.log('Cardinality could not be validated', error);
|
||||
$scope.ui.cardinalityValidator.status = STATUS.FAILED;
|
||||
$scope.ui.cardinalityValidator.message = i18n('xpack.ml.newJob.simple.enableModelPlot.validatingConfigurationErrorMessage', {
|
||||
defaultMessage: 'An error occurred validating the configuration ' +
|
||||
$scope.ui.cardinalityValidator.message = i18n.translate(
|
||||
'xpack.ml.newJob.simple.enableModelPlot.validatingConfigurationErrorMessage', {
|
||||
defaultMessage: 'An error occurred validating the configuration ' +
|
||||
'for running the job with model plot enabled. ' +
|
||||
'Creating model plots can be resource intensive and not recommended where the cardinality of the selected fields is high. ' +
|
||||
'You may want to select a dedicated results index on the Job Details tab.'
|
||||
});
|
||||
});
|
||||
// Go ahead and check the dedicated index box for them
|
||||
$scope.formConfig.useDedicatedIndex = true;
|
||||
}
|
||||
|
@ -62,7 +64,7 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
|
|||
$scope.formConfig.enableModelPlot = true;
|
||||
$scope.ui.cardinalityValidator.status = STATUS.FINISHED;
|
||||
} else {
|
||||
$scope.ui.cardinalityValidator.message = i18n('xpack.ml.newJob.simple.enableModelPlot.enableModelPlotDescription', {
|
||||
$scope.ui.cardinalityValidator.message = i18n.translate('xpack.ml.newJob.simple.enableModelPlot.enableModelPlotDescription', {
|
||||
defaultMessage: 'Creating model plots is resource intensive and not recommended ' +
|
||||
'where the cardinality of the selected fields is greater than 100. Estimated cardinality ' +
|
||||
'for this job is {highCardinality}. ' +
|
||||
|
@ -126,10 +128,10 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
|
|||
$scope.ui.cardinalityValidator.status === STATUS.FAILED) &&
|
||||
$scope.ui.formValid === true);
|
||||
const checkboxText = (validatorRunning)
|
||||
? i18n('xpack.ml.newJob.simple.enableModelPlot.validatingCardinalityLabel', {
|
||||
? i18n.translate('xpack.ml.newJob.simple.enableModelPlot.validatingCardinalityLabel', {
|
||||
defaultMessage: 'Validating cardinality…'
|
||||
})
|
||||
: i18n('xpack.ml.newJob.simple.enableModelPlot.enableModelPlotLabel', {
|
||||
: i18n.translate('xpack.ml.newJob.simple.enableModelPlot.enableModelPlotLabel', {
|
||||
defaultMessage: 'Enable model plot'
|
||||
});
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import template from './general_job_details.html';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { changeJobIDCase } from './change_job_id_case';
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
|
@ -17,16 +18,16 @@ module.directive('mlGeneralJobDetails', function () {
|
|||
restrict: 'E',
|
||||
replace: true,
|
||||
template,
|
||||
controller: function ($scope, i18n) {
|
||||
controller: function ($scope) {
|
||||
// force job ids to be lowercase
|
||||
$scope.changeJobIDCase = changeJobIDCase;
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.generalJobDetails.hideAdvancedButtonAriaLabel', {
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.generalJobDetails.hideAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Hide Advanced'
|
||||
});
|
||||
$scope.showAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.generalJobDetails.showAdvancedButtonAriaLabel', {
|
||||
$scope.showAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.generalJobDetails.showAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Show Advanced'
|
||||
});
|
||||
$scope.enterNameForJobLabel = i18n('xpack.ml.newJob.simple.generalJobDetails.enterNameForJobLabel', {
|
||||
$scope.enterNameForJobLabel = i18n.translate('xpack.ml.newJob.simple.generalJobDetails.enterNameForJobLabel', {
|
||||
defaultMessage: 'Enter a name for the job'
|
||||
});
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import { postSaveService } from './post_save_service';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { mlCreateWatchService } from 'plugins/ml/jobs/new_job/simple/components/watcher/create_watch_service';
|
||||
import { xpackFeatureProvider } from 'plugins/ml/license/check_license';
|
||||
import template from './post_save_options.html';
|
||||
|
@ -14,7 +15,7 @@ import template from './post_save_options.html';
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlPostSaveOptions', function (Private, i18n) {
|
||||
module.directive('mlPostSaveOptions', function (Private) {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
replace: false,
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
|
||||
import { mlJobService } from 'plugins/ml/services/job_service';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { mlCreateWatchService } from 'plugins/ml/jobs/new_job/simple/components/watcher/create_watch_service';
|
||||
import { mlMessageBarService } from 'plugins/ml/components/messagebar/messagebar_service';
|
||||
|
||||
|
@ -30,7 +31,7 @@ class PostSaveService {
|
|||
this.externalCreateWatch;
|
||||
}
|
||||
|
||||
startRealtimeJob(jobId, i18n) {
|
||||
startRealtimeJob(jobId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.status.realtimeJob = this.STATUS.SAVING;
|
||||
|
||||
|
@ -45,7 +46,7 @@ class PostSaveService {
|
|||
resolve();
|
||||
}).catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.postSaveOptions.couldNotStartDatafeedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.postSaveOptions.couldNotStartDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not start datafeed:'
|
||||
}), resp);
|
||||
this.status.realtimeJob = this.STATUS.SAVE_FAILED;
|
||||
|
@ -56,7 +57,7 @@ class PostSaveService {
|
|||
});
|
||||
}
|
||||
|
||||
apply(jobId, runInRealtime, createWatch, i18n) {
|
||||
apply(jobId, runInRealtime, createWatch) {
|
||||
return new Promise((resolve) => {
|
||||
if (runInRealtime) {
|
||||
this.startRealtimeJob(jobId, i18n)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ui/angular_ui_select';
|
||||
|
||||
import { aggTypes } from 'ui/agg_types';
|
||||
|
@ -62,12 +63,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreateMultiMetricJob', function (
|
||||
$scope,
|
||||
$timeout,
|
||||
Private,
|
||||
AppState,
|
||||
i18n) {
|
||||
.controller('MlCreateMultiMetricJob', function ($scope, $timeout, Private, AppState) {
|
||||
|
||||
timefilter.enableTimeRangeSelector();
|
||||
timefilter.disableAutoRefreshSelector();
|
||||
|
@ -117,19 +113,19 @@ module
|
|||
timeBasedIndexCheck(indexPattern, true);
|
||||
|
||||
const pageTitle = (savedSearch.id !== undefined) ?
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.savedSearchPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.savedSearchPageTitle', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
}) :
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.indexPatternPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.indexPatternPageTitle', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
||||
$scope.analysisStoppingLabel = i18n('xpack.ml.newJob.simple.multiMetric.analysisStoppingLabel', {
|
||||
$scope.analysisStoppingLabel = i18n.translate('xpack.ml.newJob.simple.multiMetric.analysisStoppingLabel', {
|
||||
defaultMessage: 'Analysis stopping'
|
||||
});
|
||||
$scope.stopAnalysisLabel = i18n('xpack.ml.newJob.simple.multiMetric.stopAnalysisLabel', {
|
||||
$scope.stopAnalysisLabel = i18n.translate('xpack.ml.newJob.simple.multiMetric.stopAnalysisLabel', {
|
||||
defaultMessage: 'Stop analysis'
|
||||
});
|
||||
|
||||
|
@ -149,52 +145,52 @@ module
|
|||
timeFields: [],
|
||||
splitText: '',
|
||||
intervals: [{
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.autoTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.autoTitle', {
|
||||
defaultMessage: 'Auto'
|
||||
}),
|
||||
value: 'auto',
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.millisecondTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.millisecondTitle', {
|
||||
defaultMessage: 'Millisecond'
|
||||
}),
|
||||
value: 'ms'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.secondTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.secondTitle', {
|
||||
defaultMessage: 'Second'
|
||||
}),
|
||||
value: 's'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.minuteTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.minuteTitle', {
|
||||
defaultMessage: 'Minute'
|
||||
}),
|
||||
value: 'm'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.hourlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.hourlyTitle', {
|
||||
defaultMessage: 'Hourly'
|
||||
}),
|
||||
value: 'h'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.dailyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.dailyTitle', {
|
||||
defaultMessage: 'Daily'
|
||||
}),
|
||||
value: 'd'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.weeklyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.weeklyTitle', {
|
||||
defaultMessage: 'Weekly'
|
||||
}),
|
||||
value: 'w'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.monthlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.monthlyTitle', {
|
||||
defaultMessage: 'Monthly'
|
||||
}),
|
||||
value: 'M'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.yearlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.yearlyTitle', {
|
||||
defaultMessage: 'Yearly'
|
||||
}),
|
||||
value: 'y'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.customTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.multiMetric.intervals.customTitle', {
|
||||
defaultMessage: 'Custom'
|
||||
}),
|
||||
value: 'custom'
|
||||
|
@ -253,7 +249,7 @@ module
|
|||
if (splitField !== undefined) {
|
||||
$scope.addDefaultFieldsToInfluencerList();
|
||||
|
||||
$scope.ui.splitText = i18n('xpack.ml.newJob.simple.multiMetric.dataSplitByLabel', {
|
||||
$scope.ui.splitText = i18n.translate('xpack.ml.newJob.simple.multiMetric.dataSplitByLabel', {
|
||||
defaultMessage: 'Data split by {splitFieldName}',
|
||||
values: { splitFieldName: splitField.name }
|
||||
});
|
||||
|
@ -492,13 +488,13 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.couldNotOpenJobErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.couldNotOpenJobErrorMessage', {
|
||||
defaultMessage: 'Could not open job:'
|
||||
}),
|
||||
resp
|
||||
);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.jobCreatedAndDatafeedCreatingAnywayErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.jobCreatedAndDatafeedCreatingAnywayErrorMessage', {
|
||||
defaultMessage: 'Job created, creating datafeed anyway'
|
||||
})
|
||||
);
|
||||
|
@ -510,7 +506,7 @@ module
|
|||
.catch((resp) => {
|
||||
// save failed
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.saveFailedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.saveFailedErrorMessage', {
|
||||
defaultMessage: 'Save failed:'
|
||||
}),
|
||||
resp.resp
|
||||
|
@ -558,7 +554,7 @@ module
|
|||
.catch((resp) => {
|
||||
// datafeed failed
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.couldNotStartDatafeedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.couldNotStartDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not start datafeed:'
|
||||
}),
|
||||
resp
|
||||
|
@ -573,7 +569,7 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.multiMetric.saveDatafeedFailedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.multiMetric.saveDatafeedFailedErrorMessage', {
|
||||
defaultMessage: 'Save datafeed failed:',
|
||||
}),
|
||||
resp
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
import $ from 'jquery';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import d3 from 'd3';
|
||||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
|
@ -24,7 +25,7 @@ import { mlChartTooltipService } from '../../../../../components/chart_tooltip/c
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlPopulationJobChart', function (i18n) {
|
||||
module.directive('mlPopulationJobChart', function () {
|
||||
|
||||
function link(scope, element) {
|
||||
|
||||
|
@ -233,7 +234,7 @@ module.directive('mlPopulationJobChart', function (i18n) {
|
|||
const formattedDate = formatHumanReadableDateTime(data.date);
|
||||
contents += `${formattedDate}<br/><hr/>`;
|
||||
contents += `${mlEscape(scope.overFieldName)}: ${mlEscape(data.label)}<br/>`;
|
||||
contents += i18n('xpack.ml.newJob.simple.population.chartTooltipValueLabel', {
|
||||
contents += i18n.translate('xpack.ml.newJob.simple.population.chartTooltipValueLabel', {
|
||||
defaultMessage: 'Value: {dataValue}',
|
||||
values: {
|
||||
dataValue: scope.chartData.fieldFormat !== undefined
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ui/angular_ui_select';
|
||||
|
||||
import { aggTypes } from 'ui/agg_types/index';
|
||||
|
@ -61,12 +62,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreatePopulationJob', function (
|
||||
$scope,
|
||||
$timeout,
|
||||
Private,
|
||||
AppState,
|
||||
i18n) {
|
||||
.controller('MlCreatePopulationJob', function ($scope, $timeout, Private, AppState) {
|
||||
|
||||
timefilter.enableTimeRangeSelector();
|
||||
timefilter.disableAutoRefreshSelector();
|
||||
|
@ -117,19 +113,19 @@ module
|
|||
timeBasedIndexCheck(indexPattern, true);
|
||||
|
||||
const pageTitle = (savedSearch.id !== undefined) ?
|
||||
i18n('xpack.ml.newJob.simple.population.savedSearchPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.savedSearchPageTitle', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
}) :
|
||||
i18n('xpack.ml.newJob.simple.population.indexPatternPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.indexPatternPageTitle', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
||||
$scope.analysisStoppingLabel = i18n('xpack.ml.newJob.simple.population.analysisStoppingLabel', {
|
||||
$scope.analysisStoppingLabel = i18n.translate('xpack.ml.newJob.simple.population.analysisStoppingLabel', {
|
||||
defaultMessage: 'Analysis stopping'
|
||||
});
|
||||
$scope.stopAnalysisLabel = i18n('xpack.ml.newJob.simple.population.stopAnalysisLabel', {
|
||||
$scope.stopAnalysisLabel = i18n.translate('xpack.ml.newJob.simple.population.stopAnalysisLabel', {
|
||||
defaultMessage: 'Stop analysis'
|
||||
});
|
||||
|
||||
|
@ -150,52 +146,52 @@ module
|
|||
timeFields: [],
|
||||
splitText: '',
|
||||
intervals: [{
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.autoTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.autoTitle', {
|
||||
defaultMessage: 'Auto'
|
||||
}),
|
||||
value: 'auto',
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.millisecondTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.millisecondTitle', {
|
||||
defaultMessage: 'Millisecond'
|
||||
}),
|
||||
value: 'ms'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.secondTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.secondTitle', {
|
||||
defaultMessage: 'Second'
|
||||
}),
|
||||
value: 's'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.minuteTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.minuteTitle', {
|
||||
defaultMessage: 'Minute'
|
||||
}),
|
||||
value: 'm'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.hourlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.hourlyTitle', {
|
||||
defaultMessage: 'Hourly'
|
||||
}),
|
||||
value: 'h'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.dailyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.dailyTitle', {
|
||||
defaultMessage: 'Daily'
|
||||
}),
|
||||
value: 'd'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.weeklyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.weeklyTitle', {
|
||||
defaultMessage: 'Weekly'
|
||||
}),
|
||||
value: 'w'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.monthlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.monthlyTitle', {
|
||||
defaultMessage: 'Monthly'
|
||||
}),
|
||||
value: 'M'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.yearlyTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.yearlyTitle', {
|
||||
defaultMessage: 'Yearly'
|
||||
}),
|
||||
value: 'y'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.customTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.population.intervals.customTitle', {
|
||||
defaultMessage: 'Custom'
|
||||
}),
|
||||
value: 'custom'
|
||||
|
@ -515,13 +511,13 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.couldNotOpenJobErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.couldNotOpenJobErrorMessage', {
|
||||
defaultMessage: 'Could not open job:',
|
||||
}),
|
||||
resp
|
||||
);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.jobCreatedAndDatafeedCreatingAnywayErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.jobCreatedAndDatafeedCreatingAnywayErrorMessage', {
|
||||
defaultMessage: 'Job created, creating datafeed anyway'
|
||||
})
|
||||
);
|
||||
|
@ -533,7 +529,7 @@ module
|
|||
.catch((resp) => {
|
||||
// save failed
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.saveFailedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.saveFailedErrorMessage', {
|
||||
defaultMessage: 'Save failed:',
|
||||
}),
|
||||
resp.resp
|
||||
|
@ -581,7 +577,7 @@ module
|
|||
.catch((resp) => {
|
||||
// datafeed failed
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.couldNotStartDatafeedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.couldNotStartDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not start datafeed:'
|
||||
}),
|
||||
resp
|
||||
|
@ -596,7 +592,7 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.saveDatafeedFailedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.population.saveDatafeedFailedErrorMessage', {
|
||||
defaultMessage: 'Save datafeed failed:',
|
||||
}),
|
||||
resp
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import angular from 'angular';
|
||||
import 'ui/angular_ui_select';
|
||||
import dateMath from '@elastic/datemath';
|
||||
|
@ -45,12 +46,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreateRecognizerJobs', function (
|
||||
$scope,
|
||||
$window,
|
||||
$route,
|
||||
Private,
|
||||
i18n) {
|
||||
.controller('MlCreateRecognizerJobs', function ($scope, $window, $route, Private) {
|
||||
|
||||
const mlCreateRecognizerJobsService = Private(CreateRecognizerJobsServiceProvider);
|
||||
timefilter.disableTimeRangeSelector();
|
||||
|
@ -91,24 +87,24 @@ module
|
|||
combinedQuery } = createSearchItems();
|
||||
|
||||
const pageTitle = (savedSearch.id !== undefined) ?
|
||||
i18n('xpack.ml.newJob.simple.recognize.savedSearchPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.recognize.savedSearchPageTitle', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
}) :
|
||||
i18n('xpack.ml.newJob.simple.recognize.indexPatternPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.recognize.indexPatternPageTitle', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
||||
$scope.displayQueryWarning = (savedSearch.id !== undefined);
|
||||
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.recognize.hideAdvancedButtonAriaLabel', {
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.recognize.hideAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Hide Advanced'
|
||||
});
|
||||
$scope.showAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.recognize.showAdvancedButtonAriaLabel', {
|
||||
$scope.showAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.recognize.showAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Show Advanced'
|
||||
});
|
||||
$scope.showAdvancedAriaLabel = i18n('xpack.ml.newJob.simple.recognize.showAdvancedAriaLabel', {
|
||||
$scope.showAdvancedAriaLabel = i18n.translate('xpack.ml.newJob.simple.recognize.showAdvancedAriaLabel', {
|
||||
defaultMessage: 'Show advanced'
|
||||
});
|
||||
|
||||
|
@ -119,13 +115,13 @@ module
|
|||
showJobInput: true,
|
||||
numberOfJobs: 0,
|
||||
kibanaLabels: {
|
||||
dashboard: i18n('xpack.ml.newJob.simple.recognize.dashboardsLabel', {
|
||||
dashboard: i18n.translate('xpack.ml.newJob.simple.recognize.dashboardsLabel', {
|
||||
defaultMessage: 'Dashboards'
|
||||
}),
|
||||
search: i18n('xpack.ml.newJob.simple.recognize.searchesLabel', {
|
||||
search: i18n.translate('xpack.ml.newJob.simple.recognize.searchesLabel', {
|
||||
defaultMessage: 'Searches'
|
||||
}),
|
||||
visualization: i18n('xpack.ml.newJob.simple.recognize.visualizationsLabel', {
|
||||
visualization: i18n.translate('xpack.ml.newJob.simple.recognize.visualizationsLabel', {
|
||||
defaultMessage: 'Visualizations'
|
||||
}),
|
||||
},
|
||||
|
@ -299,7 +295,7 @@ module
|
|||
} else {
|
||||
job.jobState = SAVE_STATE.FAILED;
|
||||
job.errors.push(
|
||||
i18n('xpack.ml.newJob.simple.recognize.job.couldNotSaveJobErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.recognize.job.couldNotSaveJobErrorMessage', {
|
||||
defaultMessage: 'Could not save job {jobId}',
|
||||
values: { jobId }
|
||||
})
|
||||
|
@ -321,7 +317,7 @@ module
|
|||
} else {
|
||||
job.datafeedState = SAVE_STATE.FAILED;
|
||||
job.errors.push(
|
||||
i18n('xpack.ml.newJob.simple.recognize.datafeed.couldNotSaveDatafeedErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.recognize.datafeed.couldNotSaveDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not save datafeed {datafeedId}',
|
||||
values: { datafeedId }
|
||||
})
|
||||
|
@ -348,7 +344,7 @@ module
|
|||
} else {
|
||||
obj.saveState = SAVE_STATE.FAILED;
|
||||
obj.errors.push(
|
||||
i18n('xpack.ml.newJob.simple.recognize.kibanaObject.couldNotSaveErrorMessage', {
|
||||
i18n.translate('xpack.ml.newJob.simple.recognize.kibanaObject.couldNotSaveErrorMessage', {
|
||||
defaultMessage: 'Could not save {objName} {objId}',
|
||||
values: { objName, objId: obj.id }
|
||||
})
|
||||
|
@ -363,11 +359,11 @@ module
|
|||
.catch((err) => {
|
||||
console.log('Error setting up module', err);
|
||||
toastNotifications.addWarning({
|
||||
title: i18n('xpack.ml.newJob.simple.recognize.moduleSetupFailedWarningTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.recognize.moduleSetupFailedWarningTitle', {
|
||||
defaultMessage: 'Error setting up module {moduleId}',
|
||||
values: { moduleId }
|
||||
}),
|
||||
text: i18n('xpack.ml.newJob.simple.recognize.moduleSetupFailedWarningDescription', {
|
||||
text: i18n.translate('xpack.ml.newJob.simple.recognize.moduleSetupFailedWarningDescription', {
|
||||
defaultMessage: 'An error occurred trying to create the {count, plural, one {job} other {jobs}} in the module.',
|
||||
values: {
|
||||
count: $scope.formConfig.jobs.length
|
||||
|
@ -564,7 +560,7 @@ module
|
|||
if (isJobIdValid(label) === false) {
|
||||
valid = false;
|
||||
checks.jobLabel.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.simple.recognize.jobLabelAllowedCharactersDescription', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.simple.recognize.jobLabelAllowedCharactersDescription', {
|
||||
defaultMessage: 'Job label can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' +
|
||||
'must start and end with an alphanumeric character'
|
||||
});
|
||||
|
@ -574,7 +570,7 @@ module
|
|||
if (isJobIdValid(group) === false) {
|
||||
valid = false;
|
||||
checks.groupIds.valid = false;
|
||||
const msg = i18n('xpack.ml.newJob.simple.recognize.jobGroupAllowedCharactersDescription', {
|
||||
const msg = i18n.translate('xpack.ml.newJob.simple.recognize.jobGroupAllowedCharactersDescription', {
|
||||
defaultMessage: 'Job group names can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' +
|
||||
'must start and end with an alphanumeric character'
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import 'ui/angular_ui_select';
|
||||
|
||||
import { aggTypes } from 'ui/agg_types';
|
||||
|
@ -63,14 +64,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreateSingleMetricJob', function (
|
||||
$scope,
|
||||
$route,
|
||||
$filter,
|
||||
$timeout,
|
||||
Private,
|
||||
AppState,
|
||||
i18n) {
|
||||
.controller('MlCreateSingleMetricJob', function ($scope, $route, $filter, $timeout, Private, AppState) {
|
||||
|
||||
timefilter.enableTimeRangeSelector();
|
||||
timefilter.disableAutoRefreshSelector();
|
||||
|
@ -122,25 +116,25 @@ module
|
|||
|
||||
timeBasedIndexCheck(indexPattern, true);
|
||||
|
||||
$scope.indexPatternLinkText = i18n('xpack.ml.newJob.simple.singleMetric.noResultsFound.indexPatternLinkText', {
|
||||
$scope.indexPatternLinkText = i18n.translate('xpack.ml.newJob.simple.singleMetric.noResultsFound.indexPatternLinkText', {
|
||||
defaultMessage: 'full {indexPatternTitle} data',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
$scope.nameNotValidMessage = i18n('xpack.ml.newJob.simple.singleMetric.nameNotValidMessage', {
|
||||
$scope.nameNotValidMessage = i18n.translate('xpack.ml.newJob.simple.singleMetric.nameNotValidMessage', {
|
||||
defaultMessage: 'Enter a name for the job'
|
||||
});
|
||||
$scope.showAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.singleMetric.showAdvancedButtonAriaLabel', {
|
||||
$scope.showAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.singleMetric.showAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Show Advanced'
|
||||
});
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.singleMetric.hideAdvancedButtonAriaLabel', {
|
||||
$scope.hideAdvancedButtonAriaLabel = i18n.translate('xpack.ml.newJob.simple.singleMetric.hideAdvancedButtonAriaLabel', {
|
||||
defaultMessage: 'Hide Advanced'
|
||||
});
|
||||
const pageTitle = (savedSearch.id !== undefined) ?
|
||||
i18n('xpack.ml.newJob.simple.singleMetric.savedSearchPageTitle', {
|
||||
i18n.translate('xpack.ml.newJob.simple.singleMetric.savedSearchPageTitle', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
})
|
||||
: i18n('xpack.ml.newJob.simple.singleMetric.indexPatternPageTitle', {
|
||||
: i18n.translate('xpack.ml.newJob.simple.singleMetric.indexPatternPageTitle', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
@ -158,7 +152,7 @@ module
|
|||
fields: [],
|
||||
timeFields: [],
|
||||
intervals: [{
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.autoIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.autoIntervalUnitTitle', {
|
||||
defaultMessage: 'Auto'
|
||||
}),
|
||||
value: 'auto',
|
||||
|
@ -168,47 +162,47 @@ module
|
|||
return agg.fieldIsTimeField();
|
||||
}*/
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.millisecondIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.millisecondIntervalUnitTitle', {
|
||||
defaultMessage: 'Millisecond'
|
||||
}),
|
||||
value: 'ms'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.secondIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.secondIntervalUnitTitle', {
|
||||
defaultMessage: 'Second'
|
||||
}),
|
||||
value: 's'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.minuteIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.minuteIntervalUnitTitle', {
|
||||
defaultMessage: 'Minute'
|
||||
}),
|
||||
value: 'm'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.hourlyIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.hourlyIntervalUnitTitle', {
|
||||
defaultMessage: 'Hourly'
|
||||
}),
|
||||
value: 'h'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.dailyIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.dailyIntervalUnitTitle', {
|
||||
defaultMessage: 'Daily'
|
||||
}),
|
||||
value: 'd'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.weeklyIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.weeklyIntervalUnitTitle', {
|
||||
defaultMessage: 'Weekly'
|
||||
}),
|
||||
value: 'w'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.monthlyIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.monthlyIntervalUnitTitle', {
|
||||
defaultMessage: 'Monthly'
|
||||
}),
|
||||
value: 'M'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.yearlyIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.yearlyIntervalUnitTitle', {
|
||||
defaultMessage: 'Yearly'
|
||||
}),
|
||||
value: 'y'
|
||||
}, {
|
||||
title: i18n('xpack.ml.newJob.simple.singleMetric.customIntervalUnitTitle', {
|
||||
title: i18n.translate('xpack.ml.newJob.simple.singleMetric.customIntervalUnitTitle', {
|
||||
defaultMessage: 'Custom'
|
||||
}),
|
||||
value: 'custom'
|
||||
|
@ -395,10 +389,10 @@ module
|
|||
saveNewDatafeed(job, true);
|
||||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(i18n('xpack.ml.newJob.simple.singleMetric.openJobErrorMessage', {
|
||||
msgs.error(i18n.translate('xpack.ml.newJob.simple.singleMetric.openJobErrorMessage', {
|
||||
defaultMessage: 'Could not open job: '
|
||||
}), resp);
|
||||
msgs.error(i18n('xpack.ml.newJob.simple.singleMetric.creatingDatafeedErrorMessage', {
|
||||
msgs.error(i18n.translate('xpack.ml.newJob.simple.singleMetric.creatingDatafeedErrorMessage', {
|
||||
defaultMessage: 'Job created, creating datafeed anyway'
|
||||
}));
|
||||
// if open failed, still attempt to create the datafeed
|
||||
|
@ -409,7 +403,7 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
// save failed
|
||||
msgs.error(i18n('xpack.ml.newJob.simple.singleMetric.saveFailedErrorMessage', {
|
||||
msgs.error(i18n.translate('xpack.ml.newJob.simple.singleMetric.saveFailedErrorMessage', {
|
||||
defaultMessage: 'Save failed: '
|
||||
}), resp.resp);
|
||||
$scope.$applyAsync();
|
||||
|
@ -455,7 +449,7 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
// datafeed failed
|
||||
msgs.error(i18n('xpack.ml.newJob.simple.singleMetric.datafeedNotStartedErrorMessage', {
|
||||
msgs.error(i18n.translate('xpack.ml.newJob.simple.singleMetric.datafeedNotStartedErrorMessage', {
|
||||
defaultMessage: 'Could not start datafeed: '
|
||||
}), resp);
|
||||
})
|
||||
|
@ -467,7 +461,7 @@ module
|
|||
}
|
||||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(i18n('xpack.ml.newJob.simple.singleMetric.saveDatafeedFailedErrorMessage', {
|
||||
msgs.error(i18n.translate('xpack.ml.newJob.simple.singleMetric.saveDatafeedFailedErrorMessage', {
|
||||
defaultMessage: 'Save datafeed failed: '
|
||||
}), resp);
|
||||
$scope.$applyAsync();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { checkLicenseExpired } from 'plugins/ml/license/check_license';
|
||||
import { checkCreateJobsPrivilege } from 'plugins/ml/privilege/check_privilege';
|
||||
import { getCreateJobBreadcrumbs } from 'plugins/ml/jobs/breadcrumbs';
|
||||
|
@ -40,10 +41,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.controller('MlNewJobStepJobType',
|
||||
function (
|
||||
$scope,
|
||||
Private,
|
||||
i18n) {
|
||||
function ($scope, Private) {
|
||||
|
||||
timefilter.disableTimeRangeSelector(); // remove time picker from top of page
|
||||
timefilter.disableAutoRefreshSelector(); // remove time picker from top of page
|
||||
|
@ -59,11 +57,11 @@ module.controller('MlNewJobStepJobType',
|
|||
$scope.isTimeBasedIndex = timeBasedIndexCheck(indexPattern);
|
||||
if ($scope.isTimeBasedIndex === false) {
|
||||
$scope.indexWarningTitle = (savedSearch.id === undefined) ?
|
||||
i18n('xpack.ml.newJob.wizard.jobType.indexPatternNotTimeBasedMessage', {
|
||||
i18n.translate('xpack.ml.newJob.wizard.jobType.indexPatternNotTimeBasedMessage', {
|
||||
defaultMessage: 'Index pattern {indexPatternTitle} is not time based',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
})
|
||||
: i18n('xpack.ml.newJob.wizard.jobType.indexPatternFromSavedSearchNotTimeBasedMessage', {
|
||||
: i18n.translate('xpack.ml.newJob.wizard.jobType.indexPatternFromSavedSearchNotTimeBasedMessage', {
|
||||
defaultMessage: '{savedSearchTitle} uses index pattern {indexPatternTitle} which is not time based',
|
||||
values: {
|
||||
savedSearchTitle: savedSearch.title,
|
||||
|
@ -82,11 +80,11 @@ module.controller('MlNewJobStepJobType',
|
|||
};
|
||||
|
||||
$scope.pageTitleLabel = (savedSearch.id !== undefined) ?
|
||||
i18n('xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel', {
|
||||
i18n.translate('xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
})
|
||||
: i18n('xpack.ml.newJob.wizard.jobType.indexPatternPageTitleLabel', {
|
||||
: i18n.translate('xpack.ml.newJob.wizard.jobType.indexPatternPageTitleLabel', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'ml',
|
||||
title: i18n('xpack.ml.machineLearningTitle', {
|
||||
title: i18n.translate('xpack.ml.machineLearningTitle', {
|
||||
defaultMessage: 'Machine Learning'
|
||||
}),
|
||||
description: i18n('xpack.ml.machineLearningDescription', {
|
||||
description: i18n.translate('xpack.ml.machineLearningDescription', {
|
||||
defaultMessage: 'Automatically model the normal behavior of your time series data to detect anomalies.'
|
||||
}),
|
||||
icon: 'machineLearningApp',
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
import 'plugins/ml/components/annotations/annotation_flyout/annotation_flyout_directive';
|
||||
|
@ -87,8 +88,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
Private,
|
||||
AppState,
|
||||
config,
|
||||
globalState,
|
||||
i18n) {
|
||||
globalState) {
|
||||
|
||||
$injector.get('mlSelectIntervalService');
|
||||
$injector.get('mlSelectSeverityService');
|
||||
|
@ -151,7 +151,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
const invalidIds = _.difference(selectedJobIds, timeSeriesJobIds);
|
||||
selectedJobIds = _.without(selectedJobIds, ...invalidIds);
|
||||
if (invalidIds.length > 0) {
|
||||
let warningText = i18n('xpack.ml.timeSeriesExplorer.canNotViewRequestedJobsWarningMessage', {
|
||||
let warningText = i18n.translate('xpack.ml.timeSeriesExplorer.canNotViewRequestedJobsWarningMessage', {
|
||||
defaultMessage: `You can't view requested {invalidIdsCount, plural, one {job} other {jobs}} {invalidIds} in this dashboard`,
|
||||
values: {
|
||||
invalidIdsCount: invalidIds.length,
|
||||
|
@ -159,7 +159,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
}
|
||||
});
|
||||
if (selectedJobIds.length === 0 && timeSeriesJobIds.length > 0) {
|
||||
warningText += i18n('xpack.ml.timeSeriesExplorer.autoSelectingFirstJobText', {
|
||||
warningText += i18n.translate('xpack.ml.timeSeriesExplorer.autoSelectingFirstJobText', {
|
||||
defaultMessage: ', auto selecting first job'
|
||||
});
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
if (selectedJobIds.length > 1) {
|
||||
// if more than one job, select the first job from the selection.
|
||||
toastNotifications.addWarning(
|
||||
i18n('xpack.ml.timeSeriesExplorer.youCanViewOneJobAtTimeWarningMessage', {
|
||||
i18n.translate('xpack.ml.timeSeriesExplorer.youCanViewOneJobAtTimeWarningMessage', {
|
||||
defaultMessage: 'You can only view one job at a time in this dashboard'
|
||||
})
|
||||
);
|
||||
|
@ -183,7 +183,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
if (selectedJobIds.length > 0) {
|
||||
// if the group contains valid jobs, select the first
|
||||
toastNotifications.addWarning(
|
||||
i18n('xpack.ml.timeSeriesExplorer.youCanViewOneJobAtTimeWarningMessage', {
|
||||
i18n.translate('xpack.ml.timeSeriesExplorer.youCanViewOneJobAtTimeWarningMessage', {
|
||||
defaultMessage: 'You can only view one job at a time in this dashboard'
|
||||
})
|
||||
);
|
||||
|
@ -775,7 +775,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
const appStateDtrIdx = $scope.appState.mlTimeSeriesExplorer.detectorIndex;
|
||||
let detectorIndex = appStateDtrIdx !== undefined ? appStateDtrIdx : +(viewableDetectors[0].index);
|
||||
if (_.find(viewableDetectors, { 'index': '' + detectorIndex }) === undefined) {
|
||||
const warningText = i18n('xpack.ml.timeSeriesExplorer.requestedDetectorIndexNotValidWarningMessage', {
|
||||
const warningText = i18n.translate('xpack.ml.timeSeriesExplorer.requestedDetectorIndexNotValidWarningMessage', {
|
||||
defaultMessage: 'Requested detector index {detectorIndex} is not valid for job {jobId}',
|
||||
values: {
|
||||
detectorIndex,
|
||||
|
|
|
@ -138,7 +138,7 @@ const instanceRowFactory = (scope, kbnUrl) => {
|
|||
};
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringKibanaListing', (kbnUrl, i18n) => {
|
||||
uiModule.directive('monitoringKibanaListing', kbnUrl => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
|
@ -151,7 +151,7 @@ uiModule.directive('monitoringKibanaListing', (kbnUrl, i18n) => {
|
|||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
const filterInstancesPlaceholder = i18n('xpack.monitoring.kibana.listing.filterInstancesPlaceholder', {
|
||||
const filterInstancesPlaceholder = i18n.translate('xpack.monitoring.kibana.listing.filterInstancesPlaceholder', {
|
||||
defaultMessage: 'Filter Instances…'
|
||||
});
|
||||
|
||||
|
|
|
@ -7,16 +7,17 @@
|
|||
|
||||
|
||||
import chrome from 'ui/chrome';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
|
||||
|
||||
if (chrome.getInjected('monitoringUiEnabled')) {
|
||||
FeatureCatalogueRegistryProvider.register((i18n) => {
|
||||
FeatureCatalogueRegistryProvider.register(() => {
|
||||
return {
|
||||
id: 'monitoring',
|
||||
title: i18n('xpack.monitoring.monitoringTitle', {
|
||||
title: i18n.translate('xpack.monitoring.monitoringTitle', {
|
||||
defaultMessage: 'Monitoring'
|
||||
}),
|
||||
description: i18n('xpack.monitoring.monitoringDescription', {
|
||||
description: i18n.translate('xpack.monitoring.monitoringDescription', {
|
||||
defaultMessage: 'Track the real-time health and performance of your Elastic Stack.'
|
||||
}),
|
||||
icon: 'monitoringApp',
|
||||
|
|
|
@ -5,18 +5,19 @@
|
|||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { DocTitleProvider } from 'ui/doc_title';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/title', []);
|
||||
uiModule.service('title', (Private, i18n) => {
|
||||
uiModule.service('title', Private => {
|
||||
const docTitle = Private(DocTitleProvider);
|
||||
return function changeTitle(cluster, suffix) {
|
||||
let clusterName = _.get(cluster, 'cluster_name');
|
||||
clusterName = (clusterName) ? `- ${clusterName}` : '';
|
||||
suffix = (suffix) ? `- ${suffix}` : '';
|
||||
docTitle.change(
|
||||
i18n('xpack.monitoring.stackMonitoringDocTitle', {
|
||||
i18n.translate('xpack.monitoring.stackMonitoringDocTitle', {
|
||||
defaultMessage: 'Stack Monitoring {clusterName} {suffix}',
|
||||
values: { clusterName, suffix }
|
||||
}), true);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue