Skip to content

Commit

Permalink
[i18n] Translations for Monitoring: Logstash (elastic#24897)
Browse files Browse the repository at this point in the history
* Translate Monitoring logstash

* Fix a typo

* Update unit tests
  • Loading branch information
maryia-lapata committed Nov 19, 2018
1 parent ca703e0 commit 7f7ea8b
Show file tree
Hide file tree
Showing 25 changed files with 411 additions and 129 deletions.
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"xpack.grokDebugger": "x-pack/plugins/grokdebugger",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.rollupJobs": "x-pack/plugins/rollup",
"xpack.searchProfiler": "x-pack/plugins/searchprofiler",
"xpack.security": "x-pack/plugins/security",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import React from 'react';
import { SummaryStatus } from '../../summary_status';
import { formatMetric } from '../../../lib/format_number';
import { injectI18n } from '@kbn/i18n/react';

export function ClusterStatus({ stats }) {
function ClusterStatusUi({ stats, intl }) {
const {
node_count: nodeCount,
avg_memory_used: avgMemoryUsed,
Expand All @@ -19,22 +20,30 @@ export function ClusterStatus({ stats }) {

const metrics = [
{
label: 'Nodes',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.nodesLabel', defaultMessage: 'Nodes'
}),
value: nodeCount,
dataTestSubj: 'node_count'
},
{
label: 'Memory',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.memoryLabel', defaultMessage: 'Memory'
}),
value: formatMetric(avgMemoryUsed, 'byte') + ' / ' + formatMetric(avgMemory, 'byte'),
dataTestSubj: 'memory_used'
},
{
label: 'Events Received',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.eventsReceivedLabel', defaultMessage: 'Events Received'
}),
value: formatMetric(eventsInTotal, '0.[0]a'),
dataTestSubj: 'events_in_total'
},
{
label: 'Events Emitted',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted'
}),
value: formatMetric(eventsOutTotal, '0.[0]a'),
dataTestSubj: 'events_out_total'
}
Expand All @@ -47,3 +56,5 @@ export function ClusterStatus({ stats }) {
/>
);
}

export const ClusterStatus = injectI18n(ClusterStatusUi);
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import React from 'react';
import { SummaryStatus } from '../../summary_status';
import { formatMetric } from '../../../lib/format_number';
import { injectI18n } from '@kbn/i18n/react';

export function DetailStatus({ stats }) {
function DetailStatusUi({ stats, intl }) {
const {
http_address: httpAddress,
events,
Expand All @@ -25,40 +26,54 @@ export function DetailStatus({ stats }) {
dataTestSubj: 'httpAddress'
},
{
label: 'Events Received',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.eventsReceivedLabel', defaultMessage: 'Events Received'
}),
value: formatMetric(events.in, '0.[0]a'),
dataTestSubj: 'eventsIn'
},
{
label: 'Events Emitted',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted'
}),
value: formatMetric(events.out, '0.[0]a'),
dataTestSubj: 'eventsOut'
},
{
label: 'Config Reloads',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.configReloadsLabel', defaultMessage: 'Config Reloads'
}),
value: reloads.successes,
dataTestSubj: 'numReloads'
},
{
label: 'Pipeline Workers',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.pipelineWorkersLabel', defaultMessage: 'Pipeline Workers'
}),
value: pipeline.workers,
dataTestSubj: 'pipelineWorkers'
},
{
label: 'Batch Size',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.batchSizeLabel', defaultMessage: 'Batch Size'
}),
value: pipeline.batch_size,
dataTestSubj: 'pipelineBatchSize'
}
];

const lastMetrics = [
{
label: 'Version',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.versionLabel', defaultMessage: 'Version'
}),
value: version,
dataTestSubj: 'version'
},
{
label: 'Uptime',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.uptimeLabel', defaultMessage: 'Uptime'
}),
value: formatMetric(uptime, 'time_since'),
dataTestSubj: 'uptime'
}
Expand All @@ -68,7 +83,9 @@ export function DetailStatus({ stats }) {
const metrics = [...firstMetrics];
if (queueType) {
metrics.push({
label: 'Queue Type',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.queueTypeLabel', defaultMessage: 'Queue Type'
}),
value: queueType,
dataTestSubj: 'queueType'
});
Expand All @@ -82,3 +99,5 @@ export function DetailStatus({ stats }) {
/>
);
}

export const DetailStatus = injectI18n(DetailStatusUi);
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if
>
<div>
<p>
This is a conditional statement in your pipeline.
<FormattedMessage
defaultMessage="This is a conditional statement in your pipeline."
id="xpack.monitoring.logstash.pipeline.detailDrawer.conditionalStatementDescription"
values={Object {}}
/>
</p>
<EuiCodeBlock>
if ([type] == "apache_log") {
Expand All @@ -64,7 +68,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if
/>
</div>
<p>
There are currently no metrics to show for this if condition.
<FormattedMessage
defaultMessage="There are currently no metrics to show for this if condition."
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForIfDescription"
values={Object {}}
/>
</p>
</EuiText>
</EuiFlyoutBody>
Expand Down Expand Up @@ -123,9 +131,15 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
>
<div>
<p>
This
plugin
does not have an ID explicitly specified. Specifying an ID allows you to track differences across pipeline changes. You can explicitly specify an ID for this plugin like so:
<FormattedMessage
defaultMessage="This {vertexType} does not have an ID explicitly specified. Specifying an ID allows you to track differences across pipeline changes. You can explicitly specify an ID for this plugin like so:"
id="xpack.monitoring.logstash.pipeline.detailDrawer.specifyVertexIdDescription"
values={
Object {
"vertexType": "plugin",
}
}
/>
</p>
<EuiCodeBlock>
Expand All @@ -148,7 +162,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Latency
<FormattedMessage
defaultMessage="Events Latency"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsLatencyLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -202,7 +220,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Emitted Rate
<FormattedMessage
defaultMessage="Events Emitted Rate"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedRateLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -256,7 +278,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Received
<FormattedMessage
defaultMessage="Events Received"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsReceivedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -310,7 +336,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Emitted
<FormattedMessage
defaultMessage="Events Emitted"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -415,16 +445,21 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
size="m"
>
<p>
This
plugin
's ID is
<EuiBadge
color="default"
iconSide="left"
>
parse_apache_logline
</EuiBadge>
.
<FormattedMessage
defaultMessage="This {vertexType}'s ID is {vertexId}."
id="xpack.monitoring.logstash.pipeline.detailDrawer.vertexIdDescription"
values={
Object {
"vertexId": <EuiBadge
color="default"
iconSide="left"
>
parse_apache_logline
</EuiBadge>,
"vertexType": "plugin",
}
}
/>
</p>
<EuiTable
responsive={true}
Expand All @@ -437,7 +472,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Latency
<FormattedMessage
defaultMessage="Events Latency"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsLatencyLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -491,7 +530,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Emitted Rate
<FormattedMessage
defaultMessage="Events Emitted Rate"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedRateLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -545,7 +588,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Received
<FormattedMessage
defaultMessage="Events Received"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsReceivedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -599,7 +646,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Emitted
<FormattedMessage
defaultMessage="Events Emitted"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -704,10 +755,18 @@ exports[`DetailDrawer component Queue vertices shows basic info and no stats for
size="m"
>
<p>
This is an internal structure used by Logstash to buffer events between inputs and the rest of the pipeline.
<FormattedMessage
defaultMessage="This is an internal structure used by Logstash to buffer events between inputs and the rest of the pipeline."
id="xpack.monitoring.logstash.pipeline.detailDrawer.structureDescription"
values={Object {}}
/>
</p>
<p>
There are currently no metrics to show for the queue.
<FormattedMessage
defaultMessage="There are currently no metrics to show for the queue."
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForQueueDescription"
values={Object {}}
/>
</p>
</EuiText>
</EuiFlyoutBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ exports[`Queue component renders default elements 1`] = `
grow={true}
size="m"
>
Queue metrics not available
<FormattedMessage
defaultMessage="Queue metrics not available"
id="xpack.monitoring.logstash.pipeline.queue.noMetricsDescription"
values={Object {}}
/>
</EuiText>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ exports[`Statement component renders a PluginStatement component for plugin mode
<div
className="monPipelineViewer__spaceContainer"
/>
<PluginStatement
<InjectIntl(PluginStatementUi)
onShowVertexDetails={[MockFunction]}
statement={
PluginStatement {
Expand Down
Loading

0 comments on commit 7f7ea8b

Please sign in to comment.