From 8d8513ca6cfeb7551e62ca2b84e7bcc06bb64095 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yankouski Date: Thu, 6 Sep 2018 09:55:29 +0300 Subject: [PATCH] Translations for tutorial common (#22071) * filebeat_instructions translations * tutorials common * fix translations * use unicode code * folder path to variable * Fix message id * Remove disabling no-multi-str rule, remove spaces --- .../common/tutorials/filebeat_instructions.js | 467 +++++++++++++----- .../common/tutorials/logstash_instructions.js | 53 +- .../tutorials/metricbeat_instructions.js | 428 +++++++++++----- .../tutorials/onprem_cloud_instructions.js | 47 +- 4 files changed, 718 insertions(+), 277 deletions(-) diff --git a/src/core_plugins/kibana/common/tutorials/filebeat_instructions.js b/src/core_plugins/kibana/common/tutorials/filebeat_instructions.js index 692074d2ce897b..b96f1f6b1b7d03 100644 --- a/src/core_plugins/kibana/common/tutorials/filebeat_instructions.js +++ b/src/core_plugins/kibana/common/tutorials/filebeat_instructions.js @@ -17,16 +17,22 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; import { INSTRUCTION_VARIANT } from './instruction_variant'; import { createTrycloudOption1, createTrycloudOption2 } from './onprem_cloud_instructions'; export const createFilebeatInstructions = () => ({ INSTALL: { OSX: { - title: 'Download and install Filebeat', - textPre: - 'First time using Filebeat? See the [Getting Started Guide]' + - '({config.docs.beats.filebeat}/filebeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.osxTitle', { + defaultMessage: 'Download and install Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.osxTextPre', { + defaultMessage: 'First time using Filebeat? See the [Getting Started Guide]({linkUrl}).', + values: { + linkUrl: '{config.docs.beats.filebeat}/filebeat-getting-started.html', + }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-darwin-x86_64.tar.gz', 'tar xzvf filebeat-{config.kibana.version}-darwin-x86_64.tar.gz', @@ -34,76 +40,123 @@ export const createFilebeatInstructions = () => ({ ], }, DEB: { - title: 'Download and install Filebeat', - textPre: - 'First time using Filebeat? See the [Getting Started Guide]' + - '({config.docs.beats.filebeat}/filebeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.debTitle', { + defaultMessage: 'Download and install Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.debTextPre', { + defaultMessage: 'First time using Filebeat? See the [Getting Started Guide]({linkUrl}).', + values: { + linkUrl: '{config.docs.beats.filebeat}/filebeat-getting-started.html', + }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-amd64.deb', 'sudo dpkg -i filebeat-{config.kibana.version}-amd64.deb', ], - textPost: - 'Looking for the 32-bit packages? See the [Download page](https://www.elastic.co/downloads/beats/filebeat).', + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.debTextPost', { + defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({linkUrl}).', + values: { + linkUrl: 'https://www.elastic.co/downloads/beats/filebeat', + }, + }), }, RPM: { - title: 'Download and install Filebeat', - textPre: - 'First time using Filebeat? See the [Getting Started Guide]' + - '({config.docs.beats.filebeat}/filebeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.rpmTitle', { + defaultMessage: 'Download and install Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.rpmTextPre', { + defaultMessage: 'First time using Filebeat? See the [Getting Started Guide]({linkUrl}).', + values: { + linkUrl: '{config.docs.beats.filebeat}/filebeat-getting-started.html', + }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-x86_64.rpm', 'sudo rpm -vi filebeat-{config.kibana.version}-x86_64.rpm', ], - textPost: - 'Looking for the 32-bit packages? See the [Download page](https://www.elastic.co/downloads/beats/filebeat).', + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.rpmTextPost', { + defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({linkUrl}).', + values: { + linkUrl: 'https://www.elastic.co/downloads/beats/filebeat', + }, + }), }, WINDOWS: { - title: 'Download and install Filebeat', - textPre: - 'First time using Filebeat? See the [Getting Started Guide]' + - '({config.docs.beats.filebeat}/filebeat-getting-started.html).\n' + - '1. Download the Filebeat Windows zip file from the [Download](https://www.elastic.co/downloads/beats/filebeat) page.\n' + - '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + - '3. Rename the `filebeat-{config.kibana.version}-windows` directory to `Filebeat`.\n' + - '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + - ' **Run As Administrator**). If you are running Windows XP, you might need to download and install PowerShell.\n' + - '5. From the PowerShell prompt, run the following commands to install Filebeat as a Windows service.', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.windowsTitle', { + defaultMessage: 'Download and install Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.windowsTextPre', { + defaultMessage: 'First time using Filebeat? See the [Getting Started Guide]({guideLinkUrl}).\n\ + 1. Download the Filebeat Windows zip file from the [Download]({filebeatLinkUrl}) page.\n\ + 2. Extract the contents of the zip file into {folderPath}.\n\ + 3. Rename the `{directoryName}` directory to `Filebeat`.\n\ + 4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select \ +**Run As Administrator**). If you are running Windows XP, you might need to download and install PowerShell.\n\ + 5. From the PowerShell prompt, run the following commands to install Filebeat as a Windows service.', + values: { + folderPath: '`C:\\Program Files`', + guideLinkUrl: '{config.docs.beats.filebeat}/filebeat-getting-started.html', + filebeatLinkUrl: 'https://www.elastic.co/downloads/beats/filebeat', + directoryName: 'filebeat-{config.kibana.version}-windows', + } + }), commands: [ 'PS > cd C:\\Program Files\\Filebeat', 'PS C:\\Program Files\\Filebeat> .\\install-service-filebeat.ps1', ], - textPost: - 'Modify the settings under `output.elasticsearch` in the ' + - '`C:\\Program Files\\Filebeat\\filebeat.yml` file to point to your Elasticsearch installation.', - }, + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.windowsTextPost', { + defaultMessage: 'Modify the settings under {propertyName} in the {filebeatPath} file to point to your Elasticsearch installation.', + values: { + propertyName: '`output.elasticsearch`', + filebeatPath: '`C:\\Program Files\\Filebeat\\filebeat.yml`', + } + }), + } }, START: { OSX: { - title: 'Start Filebeat', - textPre: - 'The `setup` command loads the Kibana dashboards.' + - ' If the dashboards are already set up, omit this command.', - commands: ['./filebeat setup', './filebeat -e'], + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.osxTitle', { + defaultMessage: 'Start Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.osxTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + './filebeat setup', + './filebeat -e', + ] }, DEB: { - title: 'Start Filebeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', - commands: ['sudo filebeat setup', 'sudo service filebeat start'], + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.debTitle', { + defaultMessage: 'Start Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.debTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + 'sudo filebeat setup', + 'sudo service filebeat start', + ] }, RPM: { - title: 'Start Filebeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', - commands: ['sudo filebeat setup', 'sudo service filebeat start'], + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.rpmTitle', { + defaultMessage: 'Start Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.rpmTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + 'sudo filebeat setup', + 'sudo service filebeat start', + ], }, WINDOWS: { - title: 'Start Filebeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.windowsTitle', { + defaultMessage: 'Start Filebeat', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.start.windowsTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), commands: [ 'PS C:\\Program Files\\Filebeat> filebeat.exe setup', 'PS C:\\Program Files\\Filebeat> Start-Service filebeat', @@ -112,8 +165,15 @@ export const createFilebeatInstructions = () => ({ }, CONFIG: { OSX: { - title: 'Edit the configuration', - textPre: 'Modify `filebeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.osxTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.osxTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`filebeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -122,13 +182,26 @@ export const createFilebeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.osxTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, DEB: { - title: 'Edit the configuration', - textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.debTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.debTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`/etc/filebeat/filebeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -137,13 +210,26 @@ export const createFilebeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.debTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, RPM: { - title: 'Edit the configuration', - textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.rpmTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.rpmTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`/etc/filebeat/filebeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -152,14 +238,26 @@ export const createFilebeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.rpmTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, WINDOWS: { - title: 'Edit the configuration', - textPre: - 'Modify `C:\\Program Files\\Filebeat\\filebeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.windowsTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.windowsTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`C:\\Program Files\\Filebeat\\filebeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -168,98 +266,209 @@ export const createFilebeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', - }, + textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.windowsTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), + } }, PLUGINS: { GEOIP_AND_UA: { - title: 'Install Elasticsearch GeoIP and user agent plugins', - textPre: - 'This module requires two Elasticsearch plugins that are not ' + - 'installed by default.\n\nFrom the Elasticsearch installation folder, run:', + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTitle', { + defaultMessage: 'Install Elasticsearch GeoIP and user agent plugins', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTextPre', { + defaultMessage: 'This module requires two Elasticsearch plugins that are not installed by default.\n\n\ +From the Elasticsearch installation folder, run:', + }), commands: [ 'bin/elasticsearch-plugin install ingest-geoip', 'bin/elasticsearch-plugin install ingest-user-agent', ], }, GEOIP: { - title: 'Install Elasticsearch GeoIP plugin', - textPre: - 'This module requires an Elasticsearch plugin that is not ' + - 'installed by default.\n\nFrom the Elasticsearch installation folder, run:', - commands: ['bin/elasticsearch-plugin install ingest-geoip'], - }, - }, + title: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipTitle', { + defaultMessage: 'Install Elasticsearch GeoIP plugin', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipTextPre', { + defaultMessage: 'This module requires two Elasticsearch plugins that are not installed by default.\n\n\ +From the Elasticsearch installation folder, run:', + }), + commands: [ + 'bin/elasticsearch-plugin install ingest-geoip' + ] + } + } }); export const createFilebeatCloudInstructions = () => ({ CONFIG: { OSX: { - title: 'Edit the configuration', - textPre: 'Modify `filebeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.osxTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.osxTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`filebeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.osxTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, DEB: { - title: 'Edit the configuration', - textPre: - 'Modify `/etc/filebeat/filebeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.debTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.debTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`/etc/filebeat/filebeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.debTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, RPM: { - title: 'Edit the configuration', - textPre: - 'Modify `/etc/filebeat/filebeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.rpmTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.rpmTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`/etc/filebeat/filebeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.rpmTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, WINDOWS: { - title: 'Edit the configuration', - textPre: - 'Modify `C:\\Program Files\\Filebeat\\filebeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', - }, - }, + title: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.windowsTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.windowsTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`C:\\Program Files\\Filebeat\\filebeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatCloudInstructions.config.windowsTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), + } + } }); export function filebeatEnableInstructions(moduleName) { return { OSX: { - title: 'Enable and configure the ' + moduleName + ' module', - textPre: 'From the installation directory, run:', - commands: ['./filebeat modules enable ' + moduleName], - textPost: 'Modify the settings in the `modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.osxTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.osxTextPre', { + defaultMessage: 'From the installation directory, run:', + }), + commands: [ + './filebeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.osxTextPost', { + defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, DEB: { - title: 'Enable and configure the ' + moduleName + ' module', - commands: ['sudo filebeat modules enable ' + moduleName], - textPost: 'Modify the settings in the `/etc/filebeat/modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.debTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + commands: [ + 'sudo filebeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.debTextPost', { + defaultMessage: 'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, RPM: { - title: 'Enable and configure the ' + moduleName + ' module', - commands: ['sudo filebeat modules enable ' + moduleName], - textPost: 'Modify the settings in the `/etc/filebeat/modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.rpmTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + commands: [ + 'sudo filebeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.rpmTextPost', { + defaultMessage: 'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, WINDOWS: { - title: 'Enable and configure the ' + moduleName + ' module', - textPre: 'From the `C:\\Program Files\\Filebeat` folder, run:', - commands: ['PS C:\\Program Files\\Filebeat> filebeat.exe modules enable ' + moduleName], - textPost: 'Modify the settings in the `modules.d/' + moduleName + '.yml` file.', - }, + title: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.windowsTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + textPre: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.windowsTextPre', { + defaultMessage: 'From the {path} folder, run:', + values: { path: `C:\\Program Files\\Filebeat` }, + }), + commands: [ + 'PS C:\\Program Files\\Filebeat> filebeat.exe modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.filebeatEnableInstructions.windowsTextPost', { + defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), + } }; } export function filebeatStatusCheck(moduleName) { return { - title: 'Module status', - text: 'Check that data is received from the Filebeat `' + moduleName + '` module', - btnLabel: 'Check data', - success: 'Data successfully received from this module', - error: 'No data has been received from this module yet', + title: i18n.translate('kbn.common.tutorials.filebeatStatusCheck.title', { + defaultMessage: 'Module status', + }), + text: i18n.translate('kbn.common.tutorials.filebeatStatusCheck.text', { + defaultMessage: 'Check that data is received from the Filebeat `{moduleName}` module', + values: { moduleName }, + }), + btnLabel: i18n.translate('kbn.common.tutorials.filebeatStatusCheck.buttonLabel', { + defaultMessage: 'Check data', + }), + success: i18n.translate('kbn.common.tutorials.filebeatStatusCheck.successText', { + defaultMessage: 'Data successfully received from this module', + }), + error: i18n.translate('kbn.common.tutorials.filebeatStatusCheck.errorText', { + defaultMessage: 'No data has been received from this module yet', + }), esHitsCheck: { index: 'filebeat-*', query: { @@ -299,7 +508,9 @@ export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequi return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.filebeat.premInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: variants, statusCheck: filebeatStatusCheck(moduleName), }, @@ -331,7 +542,9 @@ export function onPremCloudInstructions(moduleName, platforms) { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.filebeat.premCloudInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: variants, statusCheck: filebeatStatusCheck(moduleName), }, @@ -360,7 +573,9 @@ export function cloudInstructions(moduleName, platforms) { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.filebeat.cloudInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: variants, statusCheck: filebeatStatusCheck(moduleName), }, diff --git a/src/core_plugins/kibana/common/tutorials/logstash_instructions.js b/src/core_plugins/kibana/common/tutorials/logstash_instructions.js index 4c52314236d101..5203f44ef9c8dc 100644 --- a/src/core_plugins/kibana/common/tutorials/logstash_instructions.js +++ b/src/core_plugins/kibana/common/tutorials/logstash_instructions.js @@ -17,19 +17,28 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; + export const createLogstashInstructions = () => ({ INSTALL: { OSX: [ { - title: 'Download and install the Java Runtime Environment', - textPre: - 'Follow the installation instructions [here](https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jre.html).', + title: i18n.translate('kbn.common.tutorials.logstashInstructions.install.java.osxTitle', { + defaultMessage: 'Download and install the Java Runtime Environment', + }), + textPre: i18n.translate('kbn.common.tutorials.logstashInstructions.install.java.osxTextPre', { + defaultMessage: 'Follow the installation instructions [here]({link}).', + values: { link: 'https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jre.html' }, + }), }, { - title: 'Download and install Logstash', - textPre: - 'First time using Logstash? See the ' + - '[Getting Started Guide]({config.docs.base_url}guide/en/logstash/current/getting-started-with-logstash.html).', + title: i18n.translate('kbn.common.tutorials.logstashInstructions.install.logstash.osxTitle', { + defaultMessage: 'Download and install Logstash', + }), + textPre: i18n.translate('kbn.common.tutorials.logstashInstructions.install.logstash.osxTextPre', { + defaultMessage: 'First time using Logstash? See the [Getting Started Guide]({link}).', + values: { link: '{config.docs.base_url}guide/en/logstash/current/getting-started-with-logstash.html' }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-{config.kibana.version}.tar.gz', 'tar xzvf logstash-{config.kibana.version}.tar.gz', @@ -38,18 +47,28 @@ export const createLogstashInstructions = () => ({ ], WINDOWS: [ { - title: 'Download and install the Java Runtime Environment', - textPre: - 'Follow the installation instructions [here](https://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_jre_install.html).', + title: i18n.translate('kbn.common.tutorials.logstashInstructions.install.java.windowsTitle', { + defaultMessage: 'Download and install the Java Runtime Environment', + }), + textPre: i18n.translate('kbn.common.tutorials.logstashInstructions.install.java.windowsTextPre', { + defaultMessage: 'Follow the installation instructions [here]({link}).', + values: { link: 'https://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_jre_install.html' }, + }), }, { - title: 'Download and install Logstash', - textPre: - 'First time using Logstash? See the ' + - '[Getting Started Guide]({config.docs.base_url}guide/en/logstash/current/getting-started-with-logstash.html).\n' + - ' 1. [Download](https://artifacts.elastic.co/downloads/logstash/logstash-{config.kibana.version}.zip) the Logstash Windows zip file.\n' + - ' 2. Extract the contents of the zip file.', - }, + title: i18n.translate('kbn.common.tutorials.logstashInstructions.install.logstash.windowsTitle', { + defaultMessage: 'Download and install Logstash', + }), + textPre: i18n.translate('kbn.common.tutorials.logstashInstructions.install.logstash.windowsTextPre', { + defaultMessage: 'First time using Logstash? See the [Getting Started Guide]({logstashLink}).\n\ + 1. [Download]({elasticLink}) the Logstash Windows zip file.\n\ + 2. Extract the contents of the zip file.', + values: { + logstashLink: '{config.docs.base_url}guide/en/logstash/current/getting-started-with-logstash.html', + elasticLink: 'https://artifacts.elastic.co/downloads/logstash/logstash-{config.kibana.version}.zip' + }, + }), + } ], }, }); diff --git a/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js b/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js index 8e1b9b95bcb477..b15d3aaab1e7ed 100644 --- a/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js +++ b/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js @@ -17,16 +17,20 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; import { INSTRUCTION_VARIANT } from './instruction_variant'; import { createTrycloudOption1, createTrycloudOption2 } from './onprem_cloud_instructions'; export const createMetricbeatInstructions = () => ({ INSTALL: { OSX: { - title: 'Download and install Metricbeat', - textPre: - 'First time using Metricbeat? See the [Getting Started Guide]' + - '({config.docs.beats.metricbeat}/metricbeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.osxTitle', { + defaultMessage: 'Download and install Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.osxTextPre', { + defaultMessage: 'First time using Metricbeat? See the [Getting Started Guide]({link}).', + values: { link: '{config.docs.beats.metricbeat}/metricbeat-getting-started.html' }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', 'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz', @@ -34,76 +38,112 @@ export const createMetricbeatInstructions = () => ({ ], }, DEB: { - title: 'Download and install Metricbeat', - textPre: - 'First time using Metricbeat? See the [Getting Started Guide]' + - '({config.docs.beats.metricbeat}/metricbeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.debTitle', { + defaultMessage: 'Download and install Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.debTextPre', { + defaultMessage: 'First time using Metricbeat? See the [Getting Started Guide]({link}).', + values: { link: '{config.docs.beats.metricbeat}/metricbeat-getting-started.html' }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb', 'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb', ], - textPost: - 'Looking for the 32-bit packages? See the [Download page](https://www.elastic.co/downloads/beats/metricbeat).', + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.debTextPost', { + defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({link}).', + values: { link: 'https://www.elastic.co/downloads/beats/metricbeat' }, + }), }, RPM: { - title: 'Download and install Metricbeat', - textPre: - 'First time using Metricbeat? See the [Getting Started Guide]' + - '({config.docs.beats.metricbeat}/metricbeat-getting-started.html).', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.rpmTitle', { + defaultMessage: 'Download and install Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.rpmTextPre', { + defaultMessage: 'First time using Metricbeat? See the [Getting Started Guide]({link}).', + values: { link: '{config.docs.beats.metricbeat}/metricbeat-getting-started.html' }, + }), commands: [ 'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm', 'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm', ], - textPost: - 'Looking for the 32-bit packages? See the [Download page](https://www.elastic.co/downloads/beats/metricbeat).', + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.debTextPost', { + defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({link}).', + values: { link: 'https://www.elastic.co/downloads/beats/metricbeat' }, + }), }, WINDOWS: { - title: 'Download and install Metricbeat', - textPre: - 'First time using Metricbeat? See the [Getting Started Guide]' + - '({config.docs.beats.metricbeat}/metricbeat-getting-started.html).\n' + - '1. Download the Metricbeat Windows zip file from the [Download](https://www.elastic.co/downloads/beats/metricbeat) page.\n' + - '2. Extract the contents of the zip file into `C:\\Program Files`.\n' + - '3. Rename the `metricbeat-{config.kibana.version}-windows` directory to `Metricbeat`.\n' + - '4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' + - ' **Run As Administrator**). If you are running Windows XP, you might need to download and install PowerShell.\n' + - '5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.windowsTitle', { + defaultMessage: 'Download and install Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.windowsTextPre', { + defaultMessage: 'First time using Metricbeat? See the [Getting Started Guide]({metricbeatLink}).\n\ + 1. Download the Metricbeat Windows zip file from the [Download]({elasticLink}) page.\n\ + 2. Extract the contents of the zip file into {folderPath}.\n\ + 3. Rename the {directoryName} directory to `Metricbeat`.\n\ + 4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select \ +**Run As Administrator**). If you are running Windows XP, you might need to download and install PowerShell.\n\ + 5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.', + values: { + directoryName: '`metricbeat-{config.kibana.version}-windows`', + folderPath: '`C:\\Program Files`', + metricbeatLink: '{config.docs.beats.metricbeat}/metricbeat-getting-started.html', + elasticLink: 'https://www.elastic.co/downloads/beats/metricbeat', + }, + }), commands: [ 'PS > cd C:\\Program Files\\Metricbeat', 'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1', ], - textPost: - 'Modify the settings under `output.elasticsearch` in the ' + - '`C:\\Program Files\\Metricbeat\\metricbeat.yml` file to point to your Elasticsearch installation.', - }, + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.windowsTextPost', { + defaultMessage: 'Modify the settings under `output.elasticsearch` in the {path} file to point to your Elasticsearch installation.', + values: { path: '`C:\\Program Files\\Metricbeat\\metricbeat.yml`' }, + }), + } }, START: { OSX: { - title: 'Start Metricbeat', - textPre: - 'The `setup` command loads the Kibana dashboards.' + - ' If the dashboards are already set up, omit this command.', - commands: ['./metricbeat setup', './metricbeat -e'], + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.osxTitle', { + defaultMessage: 'Start Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.osxTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + './metricbeat setup', + './metricbeat -e', + ] }, DEB: { - title: 'Start Metricbeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', - commands: ['sudo metricbeat setup', 'sudo service metricbeat start'], + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.debTitle', { + defaultMessage: 'Start Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.debTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + 'sudo metricbeat setup', + 'sudo service metricbeat start', + ] }, RPM: { - title: 'Start Metricbeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', - commands: ['sudo metricbeat setup', 'sudo service metricbeat start'], + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.rpmTitle', { + defaultMessage: 'Start Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.rpmTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), + commands: [ + 'sudo metricbeat setup', + 'sudo service metricbeat start', + ], }, WINDOWS: { - title: 'Start Metricbeat', - textPre: - 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' + - 'omit this command.', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.windowsTitle', { + defaultMessage: 'Start Metricbeat', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.start.windowsTextPre', { + defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.', + }), commands: [ 'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup', 'PS C:\\Program Files\\Metricbeat> Start-Service metricbeat', @@ -112,8 +152,15 @@ export const createMetricbeatInstructions = () => ({ }, CONFIG: { OSX: { - title: 'Edit the configuration', - textPre: 'Modify `metricbeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.osxTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.osxTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`metricbeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -122,13 +169,26 @@ export const createMetricbeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.osxTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, DEB: { - title: 'Edit the configuration', - textPre: 'Modify `/etc/metricbeat/metricbeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.debTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.debTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`/etc/metricbeat/metricbeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -137,13 +197,26 @@ export const createMetricbeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.debTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, RPM: { - title: 'Edit the configuration', - textPre: 'Modify `/etc/metricbeat/metricbeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.rpmTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.rpmTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`/etc/metricbeat/metricbeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -152,14 +225,26 @@ export const createMetricbeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.rpmTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), }, WINDOWS: { - title: 'Edit the configuration', - textPre: - 'Modify `C:\\Program Files\\Metricbeat\\metricbeat.yml` to set the connection information:', + title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.windowsTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.windowsTextPre', { + defaultMessage: 'Modify {path} to set the connection information:', + values: { + path: '`C:\\Program Files\\Metricbeat\\metricbeat.yml`', + }, + }), commands: [ 'output.elasticsearch:', ' hosts: [""]', @@ -168,81 +253,182 @@ export const createMetricbeatInstructions = () => ({ 'setup.kibana:', ' host: ""', ], - textPost: - 'Where `` is the password of the `elastic` user, ' + - '`` is the URL of Elasticsearch, and `` is the URL of Kibana.', - }, - }, + textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.windowsTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \ +and {kibanaUrlTemplate} is the URL of Kibana.', + values: { + passwordTemplate: '``', + esUrlTemplate: '``', + kibanaUrlTemplate: '``', + }, + }), + } + } }); export const createMetricbeatCloudInstructions = () => ({ CONFIG: { OSX: { - title: 'Edit the configuration', - textPre: 'Modify `metricbeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.osxTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.osxTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`metricbeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.osxTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, DEB: { - title: 'Edit the configuration', - textPre: - 'Modify `/etc/metricbeat/metricbeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.debTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.debTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`/etc/metricbeat/metricbeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.debTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, RPM: { - title: 'Edit the configuration', - textPre: - 'Modify `/etc/metricbeat/metricbeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', + title: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.rpmTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.rpmTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`/etc/metricbeat/metricbeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.rpmTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), }, WINDOWS: { - title: 'Edit the configuration', - textPre: - 'Modify `C:\\Program Files\\Filebeat\\metricbeat.yml` to set the connection information for Elastic Cloud:', - commands: ['cloud.id: "{config.cloud.id}"', 'cloud.auth: "elastic:"'], - textPost: 'Where `` is the password of the `elastic` user.', - }, - }, + title: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.windowsTitle', { + defaultMessage: 'Edit the configuration', + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.windowsTextPre', { + defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:', + values: { + path: '`C:\\Program Files\\Metricbeat\\metricbeat.yml`', + }, + }), + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatCloudInstructions.config.windowsTextPost', { + defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.', + values: { passwordTemplate: '``' }, + }), + } + } }); export function metricbeatEnableInstructions(moduleName) { return { OSX: { - title: 'Enable and configure the ' + moduleName + ' module', - textPre: 'From the installation directory, run:', - commands: ['./metricbeat modules enable ' + moduleName], - textPost: 'Modify the settings in the `modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.osxTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.osxTextPre', { + defaultMessage: 'From the installation directory, run:', + }), + commands: [ + './metricbeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.osxTextPost', { + defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, DEB: { - title: 'Enable and configure the ' + moduleName + ' module', - commands: ['sudo metricbeat modules enable ' + moduleName], - textPost: - 'Modify the settings in the `/etc/metricbeat/modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.debTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + commands: [ + 'sudo metricbeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.debTextPost', { + defaultMessage: 'Modify the settings in the `/etc/metricbeat/modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, RPM: { - title: 'Enable and configure the ' + moduleName + ' module', - commands: ['sudo metricbeat modules enable ' + moduleName], - textPost: - 'Modify the settings in the `/etc/metricbeat/modules.d/' + moduleName + '.yml` file.', + title: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.rpmTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + commands: [ + 'sudo metricbeat modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.rpmTextPost', { + defaultMessage: 'Modify the settings in the `/etc/metricbeat/modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), }, WINDOWS: { - title: 'Enable and configure the ' + moduleName + ' module', - textPre: 'From the `C:\\Program Files\\Metricbeat` folder, run:', - commands: ['PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable ' + moduleName], - textPost: 'Modify the settings in the `modules.d/' + moduleName + '.yml` file.', - }, + title: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.windowsTitle', { + defaultMessage: 'Enable and configure the {moduleName} module', + values: { moduleName }, + }), + textPre: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.windowsTextPre', { + defaultMessage: 'From the {path} folder, run:', + values: { path: `C:\\Program Files\\Metricbeat` }, + }), + commands: [ + 'PS C:\\Program Files\\Metricbeat> metricbeat.exe modules enable ' + moduleName, + ], + textPost: i18n.translate('kbn.common.tutorials.metricbeatEnableInstructions.windowsTextPost', { + defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.', + values: { moduleName }, + }), + } }; } export function metricbeatStatusCheck(moduleName) { return { - title: 'Module status', - text: 'Check that data is received from the Metricbeat `' + moduleName + '` module', - btnLabel: 'Check data', - success: 'Data successfully received from this module', - error: 'No data has been received from this module yet', + title: i18n.translate('kbn.common.tutorials.metricbeatStatusCheck.title', { + defaultMessage: 'Module status', + }), + text: i18n.translate('kbn.common.tutorials.metricbeatStatusCheck.text', { + defaultMessage: 'Check that data is received from the Metricbeat `{moduleName}` module', + values: { moduleName }, + }), + btnLabel: i18n.translate('kbn.common.tutorials.metricbeatStatusCheck.buttonLabel', { + defaultMessage: 'Check data', + }), + success: i18n.translate('kbn.common.tutorials.metricbeatStatusCheck.successText', { + defaultMessage: 'Data successfully received from this module', + }), + error: i18n.translate('kbn.common.tutorials.metricbeatStatusCheck.errorText', { + defaultMessage: 'No data has been received from this module yet', + }), esHitsCheck: { index: 'metricbeat-*', query: { @@ -264,7 +450,9 @@ export function onPremInstructions(moduleName) { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.metricbeat.premInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX, @@ -317,7 +505,9 @@ export function onPremCloudInstructions(moduleName) { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.metricbeat.premCloudInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX, @@ -377,7 +567,9 @@ export function cloudInstructions(moduleName) { return { instructionSets: [ { - title: 'Getting Started', + title: i18n.translate('kbn.common.tutorials.metricbeat.cloudInstructions.gettingStarted.title', { + defaultMessage: 'Getting Started', + }), instructionVariants: [ { id: INSTRUCTION_VARIANT.OSX, diff --git a/src/core_plugins/kibana/common/tutorials/onprem_cloud_instructions.js b/src/core_plugins/kibana/common/tutorials/onprem_cloud_instructions.js index eec1848c06a931..088038ab5beb12 100644 --- a/src/core_plugins/kibana/common/tutorials/onprem_cloud_instructions.js +++ b/src/core_plugins/kibana/common/tutorials/onprem_cloud_instructions.js @@ -17,24 +17,39 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; + export const createTrycloudOption1 = () => ({ - title: 'Option 1: Try module in Elastic Cloud', - textPre: - 'Go to [Elastic Cloud](https://www.elastic.co/cloud/as-a-service/signup?blade=kib). Register if you ' + - 'do not already have an account. Free 14-day trial available.\n\n' + - 'Log into the Elastic Cloud console\n\n' + - 'To create a cluster, in Elastic Cloud console:\n' + - ' 1. Select **Create Deployment** and specify the **Deployment Name**\n' + - ' 2. Modify the other deployment options as needed (or not, the defaults are great to get started)\n' + - ' 3. Click **Create Deployment**\n' + - ' 4. Wait until deployment creation completes\n' + - ' 5. Go to the new Cloud Kibana instance and follow the Kibana Home instructions', + title: i18n.translate('kbn.common.tutorials.premCloudInstructions.option1.title', { + defaultMessage: 'Option 1: Try module in Elastic Cloud', + }), + textPre: i18n.translate('kbn.common.tutorials.premCloudInstructions.option1.textPre', { + defaultMessage: 'Go to [Elastic Cloud]({link}). Register if you \ +do not already have an account. Free 14-day trial available.\n\n\ +Log into the Elastic Cloud console\n\n\ +To create a cluster, in Elastic Cloud console:\n\ + 1. Select **Create Deployment** and specify the **Deployment Name**\n\ + 2. Modify the other deployment options as needed (or not, the defaults are great to get started)\n\ + 3. Click **Create Deployment**\n\ + 4. Wait until deployment creation completes\n\ + 5. Go to the new Cloud Kibana instance and follow the Kibana Home instructions', + values: { + link: 'https://www.elastic.co/cloud/as-a-service/signup?blade=kib', + } + }), }); export const createTrycloudOption2 = () => ({ - title: 'Option 2: Connect local Kibana to a Cloud instance', - textPre: - 'If you are running this Kibana instance against a hosted Elasticsearch instance,' + - ' proceed with manual setup.\n\n' + - 'Save the **Elasticsearch** endpoint as `` and the cluster **Password** as `` for your records', + title: i18n.translate('kbn.common.tutorials.premCloudInstructions.option2.title', { + defaultMessage: 'Option 2: Connect local Kibana to a Cloud instance', + }), + textPre: i18n.translate('kbn.common.tutorials.premCloudInstructions.option2.textPre', { + defaultMessage: 'If you are running this Kibana instance against a hosted Elasticsearch instance, \ +proceed with manual setup.\n\n\ +Save the **Elasticsearch** endpoint as {urlTemplate} and the cluster **Password** as {passwordTemplate} for your records', + values: { + urlTemplate: '``', + passwordTemplate: '``', + } + }), });