From 546293185385b1f33dfab55b34bf7ca9001b8690 Mon Sep 17 00:00:00 2001 From: Leanid Shutau Date: Wed, 29 Aug 2018 16:52:27 +0300 Subject: [PATCH] Add translations for Netflow tutorial (#22138) --- .../tutorials/netflow/common_instructions.js | 237 +++++++++++++++--- .../server/tutorials/netflow/elastic_cloud.js | 6 +- .../kibana/server/tutorials/netflow/index.js | 22 +- .../server/tutorials/netflow/on_prem.js | 6 +- .../netflow/on_prem_elastic_cloud.js | 6 +- 5 files changed, 228 insertions(+), 49 deletions(-) diff --git a/src/core_plugins/kibana/server/tutorials/netflow/common_instructions.js b/src/core_plugins/kibana/server/tutorials/netflow/common_instructions.js index eaf554d6b21895..f5c1b85bb8c925 100644 --- a/src/core_plugins/kibana/server/tutorials/netflow/common_instructions.js +++ b/src/core_plugins/kibana/server/tutorials/netflow/common_instructions.js @@ -17,34 +17,90 @@ * under the License. */ +/* eslint-disable no-multi-str */ + +import { i18n } from '@kbn/i18n'; + export function createCommonNetflowInstructions() { return { CONFIG: { ON_PREM: { OSX: [ { - title: 'Edit the configuration', - textPre: 'Modify `config/logstash.yml` to set the configuration parameters:', + title: i18n.translate('kbn.server.tutorials.netflow.common.config.onPrem.osxTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPrem.osxTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config/logstash.yml`', + }, + } + ), commands: ['modules:', ' - name: netflow', ' var.input.udp.port: '], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPrem.osxTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data.', + values: { + udpPort: '``', + }, + } + ), }, ], WINDOWS: [ { - title: 'Edit the configuration', - textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:', + title: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPrem.windowsTitle', + { + defaultMessage: 'Edit the configuration', + } + ), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPrem.windowsTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config\\logstash.yml`', + }, + } + ), commands: ['modules:', ' - name: netflow', ' var.input.udp.port: '], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPrem.windowsTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data.', + values: { + udpPort: '``', + }, + } + ), }, ], }, ON_PREM_ELASTIC_CLOUD: { OSX: [ { - title: 'Edit the configuration', - textPre: 'Modify `config/logstash.yml` to set the configuration parameters:', + title: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTitle', + { + defaultMessage: 'Edit the configuration', + } + ), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config/logstash.yml`', + }, + } + ), commands: [ 'modules:', ' - name: netflow', @@ -53,16 +109,40 @@ export function createCommonNetflowInstructions() { ' var.elasticsearch.username: elastic', ' var.elasticsearch.password: ', ], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data, ' + - '`` is the URL of Elasticsearch running on Elastic Cloud, and ' + - '`` is the password of the `elastic` user.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data, \ + {esUrl} is the URL of Elasticsearch running on Elastic Cloud, and \ + {password} is the password of the {elastic} user.', + values: { + elastic: '`elastic`', + esUrl: '``', + password: '``', + udpPort: '``', + }, + } + ), }, ], WINDOWS: [ { - title: 'Edit the configuration', - textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:', + title: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTitle', + { + defaultMessage: 'Edit the configuration', + } + ), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config\\logstash.yml`', + }, + } + ), commands: [ 'modules:', ' - name: netflow', @@ -71,18 +151,42 @@ export function createCommonNetflowInstructions() { ' var.elasticsearch.username: elastic', ' var.elasticsearch.password: ', ], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data, ' + - '`` is the URL of Elasticsearch running on Elastic Cloud, and ' + - '`` is the password of the `elastic` user.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data, \ + {esUrl} is the URL of Elasticsearch running on Elastic Cloud, and \ + {password} is the password of the {elastic} user.', + values: { + elastic: '`elastic`', + esUrl: '``', + password: '``', + udpPort: '``', + }, + } + ), }, ], }, ELASTIC_CLOUD: { OSX: [ { - title: 'Edit the configuration', - textPre: 'Modify `config/logstash.yml` to set the configuration parameters:', + title: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTitle', + { + defaultMessage: 'Edit the configuration', + } + ), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config/logstash.yml`', + }, + } + ), commands: [ 'cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"', @@ -91,15 +195,38 @@ export function createCommonNetflowInstructions() { ' - name: netflow', ' var.input.udp.port: ', ], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data and ' + - '`` is the password of the `elastic` user.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data and \ + {password} is the password of the {elastic} user.', + values: { + elastic: '`elastic`', + password: '``', + udpPort: '``', + }, + } + ), }, ], WINDOWS: [ { - title: 'Edit the configuration', - textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:', + title: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTitle', + { + defaultMessage: 'Edit the configuration', + } + ), + textPre: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTextPre', + { + defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:', + values: { + logstashConfigPath: '`config\\logstash.yml`', + }, + } + ), commands: [ 'cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"', @@ -108,9 +235,19 @@ export function createCommonNetflowInstructions() { ' - name: netflow', ' var.input.udp.port: ', ], - textPost: - 'Where `` is the UDP port on which Logstash will receive Netflow data and ' + - '`` is the password of the `elastic` user.', + textPost: i18n.translate( + 'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTextPost', + { + defaultMessage: + 'Where {udpPort} is the UDP port on which Logstash will receive Netflow data and \ + {password} is the password of the {elastic} user.', + values: { + elastic: '`elastic`', + password: '``', + udpPort: '``', + }, + } + ), }, ], }, @@ -118,22 +255,42 @@ export function createCommonNetflowInstructions() { SETUP: { OSX: [ { - title: 'Run the Netflow module', - textPre: 'Run:', + title: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTitle', { + defaultMessage: 'Run the Netflow module', + }), + textPre: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTextPre', { + defaultMessage: 'Run:', + }), commands: ['./bin/logstash --modules netflow --setup'], - textPost: - 'The `--setup` option creates a `netflow-*` index pattern in Elasticsearch and imports' + - ' Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.', + textPost: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTextPost', { + defaultMessage: + 'The {setupOption} option creates a {netflowPrefix} index pattern in Elasticsearch and imports \ + Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.', + values: { + setupOption: '`--setup`', + netflowPrefix: '`netflow-*`', + }, + }), }, ], WINDOWS: [ { - title: 'Run the Netflow module', - textPre: 'Run:', + title: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTitle', { + defaultMessage: 'Run the Netflow module', + }), + textPre: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTextPre', { + defaultMessage: 'Run:', + }), commands: ['bin\\logstash --modules netflow --setup'], - textPost: - 'The `--setup` option creates a `netflow-*` index pattern in Elasticsearch and imports' + - ' Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.', + textPost: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTextPost', { + defaultMessage: + 'The {setupOption} option creates a {netflowPrefix} index pattern in Elasticsearch and imports \ + Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.', + values: { + setupOption: '`--setup`', + netflowPrefix: '`netflow-*`', + }, + }), }, ], }, diff --git a/src/core_plugins/kibana/server/tutorials/netflow/elastic_cloud.js b/src/core_plugins/kibana/server/tutorials/netflow/elastic_cloud.js index ddb3afc0488fdb..6ba76c2b5fa9c2 100644 --- a/src/core_plugins/kibana/server/tutorials/netflow/elastic_cloud.js +++ b/src/core_plugins/kibana/server/tutorials/netflow/elastic_cloud.js @@ -17,6 +17,8 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; + import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions'; import { createCommonNetflowInstructions } from './common_instructions'; @@ -29,7 +31,9 @@ export function createElasticCloudInstructions() { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.server.tutorials.netflow.elasticCloudInstructions.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX, diff --git a/src/core_plugins/kibana/server/tutorials/netflow/index.js b/src/core_plugins/kibana/server/tutorials/netflow/index.js index 6337959e01f7df..682d7cb8d46cc7 100644 --- a/src/core_plugins/kibana/server/tutorials/netflow/index.js +++ b/src/core_plugins/kibana/server/tutorials/netflow/index.js @@ -17,6 +17,10 @@ * under the License. */ +/* eslint-disable no-multi-str */ + +import { i18n } from '@kbn/i18n'; + import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category'; import { createOnPremInstructions } from './on_prem'; import { createElasticCloudInstructions } from './elastic_cloud'; @@ -27,12 +31,18 @@ export function netflowSpecProvider() { id: 'netflow', name: 'Netflow', category: TUTORIAL_CATEGORY.SECURITY, - shortDescription: 'Collect Netflow records sent by a Netflow exporter.', - longDescription: - 'The Logstash Netflow module collects and parses network flow data, ' + - ' indexes the events into Elasticsearch, and installs a suite of Kibana dashboards.' + - ' This module support Netflow Version 5 and 9.' + - ' [Learn more]({config.docs.logstash}/netflow-module.html).', + shortDescription: i18n.translate('kbn.server.tutorials.netflow.tutorialShortDescription', { + defaultMessage: 'Collect Netflow records sent by a Netflow exporter.', + }), + longDescription: i18n.translate('kbn.server.tutorials.netflow.tutorialLongDescription', { + defaultMessage: + 'The Logstash Netflow module collects and parses network flow data, \ +indexes the events into Elasticsearch, and installs a suite of Kibana dashboards. \ +This module support Netflow Version 5 and 9. [Learn more]({linkUrl}).', + values: { + linkUrl: '{config.docs.logstash}/netflow-module.html', + }, + }), artifacts: { dashboards: [ { diff --git a/src/core_plugins/kibana/server/tutorials/netflow/on_prem.js b/src/core_plugins/kibana/server/tutorials/netflow/on_prem.js index 6fb41ee0eb9d36..cc060611361bdc 100644 --- a/src/core_plugins/kibana/server/tutorials/netflow/on_prem.js +++ b/src/core_plugins/kibana/server/tutorials/netflow/on_prem.js @@ -17,6 +17,8 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; + import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions'; import { createCommonNetflowInstructions } from './common_instructions'; @@ -29,7 +31,9 @@ export function createOnPremInstructions() { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.server.tutorials.netflow.onPremInstructions.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX, diff --git a/src/core_plugins/kibana/server/tutorials/netflow/on_prem_elastic_cloud.js b/src/core_plugins/kibana/server/tutorials/netflow/on_prem_elastic_cloud.js index 87f647882518f5..49674621b70be8 100644 --- a/src/core_plugins/kibana/server/tutorials/netflow/on_prem_elastic_cloud.js +++ b/src/core_plugins/kibana/server/tutorials/netflow/on_prem_elastic_cloud.js @@ -17,6 +17,8 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; + import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions'; import { @@ -35,7 +37,9 @@ export function createOnPremElasticCloudInstructions() { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.server.tutorials.netflow.onPremElasticCloudInstructions.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX,