Skip to content

Commit

Permalink
[i18n] Translate ML - File Datavisualizer (Part 1) (elastic#25641) (e…
Browse files Browse the repository at this point in the history
…lastic#26969)

translate file_datavisualizer folder of Machine Learning (Part 1)
  • Loading branch information
pavel06081991 authored Dec 12, 2018
1 parent ec598c5 commit fff9f1d
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

import {
Expand Down Expand Up @@ -36,7 +37,12 @@ export function AboutPanel({ onFilePickerChange }) {
<div style={{ textAlign: 'center' }} >
<EuiFilePicker
id="filePicker"
initialPromptText="Select or drag and drop a file"
initialPromptText={
<FormattedMessage
id="xpack.ml.fileDatavisualizer.aboutPanel.selectOrDragAndDropFileDescription"
defaultMessage="Select or drag and drop a file"
/>
}
onChange={files => onFilePickerChange(files)}
className="file-datavisualizer-file-picker"
/>
Expand All @@ -58,7 +64,12 @@ export function LoadingPanel() {
<EuiFlexItem grow={false}>
<EuiPanel paddingSize="l" style={{ textAlign: 'center' }} >
<EuiTitle size="s">
<h3>Analyzing data</h3>
<h3>
<FormattedMessage
id="xpack.ml.fileDatavisualizer.aboutPanel.analyzingDataTitle"
defaultMessage="Analyzing data"
/>
</h3>
</EuiTitle>

<EuiSpacer size="l" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

import {
Expand All @@ -29,23 +30,41 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiTitle size="m">
<h3>
Visualize data from a log file &nbsp;
<ExperimentalBadge
tooltipContent="Experimental feature. We'd love to hear your feedback."
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.visualizeDataFromLogFileTitle"
defaultMessage="Visualize data from a log file&nbsp;{experimentalBadge}"
values={{
experimentalBadge: (
<ExperimentalBadge
tooltipContent={
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.experimentalFeatureTooltip"
defaultMessage="Experimental feature. We'd love to hear your feedback."
/>
}
/>
),
}}
/>
</h3>
</EuiTitle>
<EuiSpacer size="s" />
<EuiText>
<p>
The File Data Visualizer helps you understand the fields and metrics in a log file.
Upload your file, analyze its data, and then choose whether to import the data into an Elasticsearch index.
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.visualizeDataFromLogFileDescription"
defaultMessage="The File Data Visualizer helps you understand the fields and metrics in a log file.
Upload your file, analyze its data, and then choose whether to import the data into an Elasticsearch index."
/>
</p>
</EuiText>
<EuiSpacer size="s" />
<EuiText>
<p>
The File Data Visualizer supports these file formats:
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.supportedFileFormatDescription"
defaultMessage="The File Data Visualizer supports these file formats:"
/>
</p>
</EuiText>
<EuiSpacer size="m" />
Expand All @@ -56,7 +75,10 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiText>
<p>
Delimited text files, such as CSV and TSV
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.delimitedTextFilesDescription"
defaultMessage="Delimited text files, such as CSV and TSV"
/>
</p>
</EuiText>
</EuiFlexItem>
Expand All @@ -69,7 +91,10 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiText>
<p>
Newline-delimited JSON
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.newlineDelimitedJsonDescription"
defaultMessage="Newline-delimited JSON"
/>
</p>
</EuiText>
</EuiFlexItem>
Expand All @@ -82,27 +107,40 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiText>
<p>
Log files with a common format for the timestamp
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.logFilesWithCommonFormatDescription"
defaultMessage="Log files with a common format for the timestamp"
/>
</p>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiText>
<p>
You can upload files up to 100 MB.
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.uploadedFilesAllowedSizeDescription"
defaultMessage="You can upload files up to 100 MB."
/>
</p>
</EuiText>
<EuiSpacer size="s" />
<EuiText>
<p>
This feature is experimental. Got feedback? Please create an issue in&nbsp;
<EuiLink
href="https://github.com/elastic/kibana/issues/new"
target="_blank"
>
GitHub
</EuiLink>.
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.experimentalFeatureDescription"
defaultMessage="This feature is experimental. Got feedback? Please create an issue in&nbsp;{githubLink}."
values={{
githubLink: (
<EuiLink
href="https://github.com/elastic/kibana/issues/new"
target="_blank"
>
GitHub
</EuiLink>
)
}}
/>
</p>
</EuiText>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

import {
Expand All @@ -19,7 +20,12 @@ export function AnalysisSummary({ results }) {
return (
<React.Fragment>
<EuiTitle size="s">
<h3>Summary</h3>
<h3>
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.summaryTitle"
defaultMessage="Summary"
/>
</h3>
</EuiTitle>

<EuiSpacer size="m" />
Expand All @@ -36,7 +42,12 @@ export function AnalysisSummary({ results }) {
function createDisplayItems(results) {
const items = [
{
title: 'Number of lines analyzed',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.analyzedLinesNumberTitle"
defaultMessage="Number of lines analyzed"
/>
),
description: results.num_lines_analyzed,
},
// {
Expand All @@ -47,18 +58,33 @@ function createDisplayItems(results) {

if (results.format !== undefined) {
items.push({
title: 'Format',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.formatTitle"
defaultMessage="Format"
/>
),
description: results.format,
});

if (results.format === 'delimited') {
items.push({
title: 'Delimiter',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.delimiterTitle"
defaultMessage="Delimiter"
/>
),
description: results.delimiter,
});

items.push({
title: 'Has header row',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.hasHeaderRowTitle"
defaultMessage="Has header row"
/>
),
description: `${results.has_header_row}`,
});

Expand All @@ -67,22 +93,39 @@ function createDisplayItems(results) {

if (results.grok_pattern !== undefined) {
items.push({
title: 'Grok pattern',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.grokPatternTitle"
defaultMessage="Grok pattern"
/>
),
description: results.grok_pattern,
});
}

if (results.timestamp_field !== undefined) {
items.push({
title: 'Time field',
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.timeFieldTitle"
defaultMessage="Time field"
/>
),
description: results.timestamp_field,
});
}

if (results.joda_timestamp_formats !== undefined) {
const s = (results.joda_timestamp_formats.length > 1) ? 's' : '';
items.push({
title: `Time format${s}`,
title: (
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.timeFormatTitle"
defaultMessage="Time {timestampFormats, plural, zero {format} one {format} other {formats}}"
values={{
timestampFormats: results.joda_timestamp_formats.length,
}}
/>
),
description: results.joda_timestamp_formats.join(', '),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

import {
Expand All @@ -28,15 +29,21 @@ export function BottomBar({ showBar, mode, changeMode, onCancel }) {
fill
onClick={() => changeMode(DATAVISUALIZER_MODE.IMPORT)}
>
Import
<FormattedMessage
id="xpack.ml.fileDatavisualizer.bottomBar.readMode.importButtonLabel"
defaultMessage="Import"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
color="ghost"
onClick={() => onCancel()}
>
Cancel
<FormattedMessage
id="xpack.ml.fileDatavisualizer.bottomBar.readMode.cancelButtonLabel"
defaultMessage="Cancel"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -52,15 +59,21 @@ export function BottomBar({ showBar, mode, changeMode, onCancel }) {
color="ghost"
onClick={() => changeMode(DATAVISUALIZER_MODE.READ)}
>
Back
<FormattedMessage
id="xpack.ml.fileDatavisualizer.bottomBar.backButtonLabel"
defaultMessage="Back"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
color="ghost"
onClick={() => onCancel()}
>
Cancel
<FormattedMessage
id="xpack.ml.fileDatavisualizer.bottomBar.cancelButtonLabel"
defaultMessage="Cancel"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ exports[`Overrides render overrides 1`] = `
describedByIds={Array []}
fullWidth={false}
hasEmptyLabelSpace={false}
label="Data format"
label={
<FormattedMessage
defaultMessage="Data format"
id="xpack.ml.fileDatavisualizer.editFlyout.overrides.dataFormatFormRowLabel"
values={Object {}}
/>
}
>
<EuiSuperSelect
onChange={[Function]}
Expand Down Expand Up @@ -44,7 +50,13 @@ exports[`Overrides render overrides 1`] = `
describedByIds={Array []}
fullWidth={false}
hasEmptyLabelSpace={false}
label="Timestamp format"
label={
<FormattedMessage
defaultMessage="Timestamp format"
id="xpack.ml.fileDatavisualizer.editFlyout.overrides.timestampFormatFormRowLabel"
values={Object {}}
/>
}
>
<EuiSuperSelect
onChange={[Function]}
Expand Down Expand Up @@ -454,7 +466,13 @@ exports[`Overrides render overrides 1`] = `
describedByIds={Array []}
fullWidth={false}
hasEmptyLabelSpace={false}
label="Time field"
label={
<FormattedMessage
defaultMessage="Time field"
id="xpack.ml.fileDatavisualizer.editFlyout.overrides.timeFieldFormRowLabel"
values={Object {}}
/>
}
>
<EuiSuperSelect
onChange={[Function]}
Expand Down
Loading

0 comments on commit fff9f1d

Please sign in to comment.