Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate tutorials(elasticsearch_metrics, etcd_metrics, golang_metri… #22121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,36 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function elasticsearchMetricsSpecProvider() {
const moduleName = 'elasticsearch';
return {
id: 'elasticsearchMetrics',
name: 'Elasticsearch metrics',
name: i18n.translate('kbn.server.tutorials.elasticsearchMetrics.nameTitle', {
defaultMessage: 'Elasticsearch metrics',
}),
isBeta: true,
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: 'Fetch internal metrics from Elasticsearch.',
longDescription: 'The `elasticsearch` Metricbeat module fetches internal metrics from Elasticsearch.' +
' [Learn more]({config.docs.beats.metricbeat}/metricbeat-module-elasticsearch.html).',
shortDescription: i18n.translate('kbn.server.tutorials.elasticsearchMetrics.shortDescription', {
defaultMessage: 'Fetch internal metrics from Elasticsearch.',
}),
longDescription: i18n.translate('kbn.server.tutorials.elasticsearchMetrics.longDescription', {
// eslint-disable-next-line no-multi-str
defaultMessage: 'The `elasticsearch` Metricbeat module fetches internal metrics from Elasticsearch. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-elasticsearch.html',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this link always lead to the EN version of the Elastic site?
https://www.elastic.co/guide/en/beats/metricbeat/6.3/metricbeat-module-elasticsearch.html?

Answer is not stopping this PR. I'm just curious if the i18n framework can change a URL part based on locale

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azasypkin maybe you could help with clarification?

Copy link
Member

@azasypkin azasypkin Aug 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a high chance that the set of locales we support in Kibana and have documentation for will be different so I'd not rely on anything "automatic" here, but we can add context field where we ask localizers to ping us and check whether we have docs for the locale they are currently working on so that every time we generate these labels for vendor to translate they will see that context field and can get back to us and clarify. For that to work we also will have to construct this link differently so that localizers can have access to this guide/en/beats part.

},
}),
euiIconType: 'logoElasticsearch',
artifacts: {
application: {
label: 'Discover',
label: i18n.translate('kbn.server.tutorials.elasticsearchMetrics.artifacts.application.label', {
defaultMessage: 'Discover',
}),
path: '/app/kibana#/discover'
},
dashboards: [],
Expand Down
23 changes: 18 additions & 5 deletions src/core_plugins/kibana/server/tutorials/etcd_metrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,35 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function etcdMetricsSpecProvider() {
const moduleName = 'etcd';
return {
id: 'etcdMetrics',
name: 'Etcd metrics',
name: i18n.translate('kbn.server.tutorials.etcdMetrics.nameTitle', {
defaultMessage: 'Etcd metrics',
}),
isBeta: true,
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: 'Fetch internal metrics from the Etcd server.',
longDescription: 'The `etcd` Metricbeat module fetches internal metrics from Etcd.' +
' [Learn more]({config.docs.beats.metricbeat}/metricbeat-module-etcd.html).',
shortDescription: i18n.translate('kbn.server.tutorials.etcdMetrics.shortDescription', {
defaultMessage: 'Fetch internal metrics from the Etcd server.',
}),
longDescription: i18n.translate('kbn.server.tutorials.etcdMetrics.longDescription', {
// eslint-disable-next-line no-multi-str
defaultMessage: 'The `etcd` Metricbeat module fetches internal metrics from Etcd. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-etcd.html',
},
}),
artifacts: {
application: {
label: 'Discover',
label: i18n.translate('kbn.server.tutorials.etcdMetrics.artifacts.application.label', {
defaultMessage: 'Discover',
}),
path: '/app/kibana#/discover'
},
dashboards: [],
Expand Down
24 changes: 19 additions & 5 deletions src/core_plugins/kibana/server/tutorials/golang_metrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,38 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function golangMetricsSpecProvider() {
const moduleName = 'golang';
return {
id: moduleName + 'Metrics',
name: 'Golang metrics',
name: i18n.translate('kbn.server.tutorials.golangMetrics.nameTitle', {
defaultMessage: 'Golang metrics',
}),
isBeta: true,
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: 'Fetch internal metrics from a Golang app.',
longDescription: 'The `' + moduleName + '` Metricbeat module fetches internal metrics from a Golang app.' +
' [Learn more]({config.docs.beats.metricbeat}/metricbeat-module-' + moduleName + '.html).',
shortDescription: i18n.translate('kbn.server.tutorials.golangMetrics.shortDescription', {
defaultMessage: 'Fetch internal metrics from a Golang app.',
}),
longDescription: i18n.translate('kbn.server.tutorials.golangMetrics.longDescription', {
// eslint-disable-next-line no-multi-str
defaultMessage: 'The `{moduleName}` Metricbeat module fetches internal metrics from a Golang app. \
[Learn more]({learnMoreLink}).',
values: {
moduleName,
learnMoreLink: `{config.docs.beats.metricbeat}/metricbeat-module-${moduleName}.html`,
},
}),
artifacts: {
dashboards: [
{
id: 'f2dc7320-f519-11e6-a3c9-9d1f7c42b045',
linkLabel: 'Golang metrics dashboard',
linkLabel: i18n.translate('kbn.server.tutorials.golangMetrics.artifacts.dashboards.linkLabel', {
defaultMessage: 'Golang metrics dashboard',
}),
isOverview: true
}
],
Expand Down
23 changes: 18 additions & 5 deletions src/core_plugins/kibana/server/tutorials/haproxy_metrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,35 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function haproxyMetricsSpecProvider() {
const moduleName = 'haproxy';
return {
id: 'haproxyMetrics',
name: 'HAProxy metrics',
name: i18n.translate('kbn.server.tutorials.haproxyMetrics.nameTitle', {
defaultMessage: 'HAProxy metrics',
}),
isBeta: true,
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: 'Fetch internal metrics from the HAProxy server.',
longDescription: 'The `haproxy` Metricbeat module fetches internal metrics from HAProxy.' +
' [Learn more]({config.docs.beats.metricbeat}/metricbeat-module-haproxy.html).',
shortDescription: i18n.translate('kbn.server.tutorials.haproxyMetrics.shortDescription', {
defaultMessage: 'Fetch internal metrics from the HAProxy server.',
}),
longDescription: i18n.translate('kbn.server.tutorials.haproxyMetrics.longDescription', {
// eslint-disable-next-line no-multi-str
defaultMessage: 'The `haproxy` Metricbeat module fetches internal metrics from HAProxy. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-haproxy.html',
},
}),
artifacts: {
application: {
label: 'Discover',
label: i18n.translate('kbn.server.tutorials.haproxyMetrics.artifacts.application.label', {
defaultMessage: 'Discover',
}),
path: '/app/kibana#/discover'
},
dashboards: [],
Expand Down
23 changes: 18 additions & 5 deletions src/core_plugins/kibana/server/tutorials/iis_logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';

Expand All @@ -27,17 +28,29 @@ export function iisLogsSpecProvider() {
const platforms = ['WINDOWS'];
return {
id: 'iisLogs',
name: 'IIS logs',
name: i18n.translate('kbn.server.tutorials.iisLogs.nameTitle', {
defaultMessage: 'IIS logs',
}),
category: TUTORIAL_CATEGORY.LOGGING,
shortDescription: 'Collect and parse access and error logs created by the IIS HTTP server.',
longDescription: 'The `iis` Filebeat module parses access and error logs created by the IIS HTTP server.' +
' [Learn more]({config.docs.beats.filebeat}/filebeat-module-iis.html).',
shortDescription: i18n.translate('kbn.server.tutorials.iisLogs.shortDescription', {
defaultMessage: 'Collect and parse access and error logs created by the IIS HTTP server.',
}),
longDescription: i18n.translate('kbn.server.tutorials.iisLogs.longDescription', {
// eslint-disable-next-line no-multi-str
defaultMessage: 'The `iis` Filebeat module parses access and error logs created by the IIS HTTP server. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-iis.html',
},
}),
//euiIconType: 'logoIIS',
artifacts: {
dashboards: [
{
id: '4278ad30-fe16-11e7-a3b0-d13028918f9f',
linkLabel: 'IIS logs dashboard',
linkLabel: i18n.translate('kbn.server.tutorials.iisLogs.artifacts.dashboards.linkLabel', {
defaultMessage: 'IIS logs dashboard',
}),
isOverview: true
}
],
Expand Down