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

Add missing translations #42921

Merged
merged 1 commit into from
Aug 8, 2019
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 @@ -134,7 +134,15 @@ export const datatableVisualization: Visualization<
const title = i18n.translate('xpack.lens.datatable.visualizationOf', {
defaultMessage: 'Table: {operations}',
values: {
operations: table.columns.map(col => col.operation.label).join(' & '),
operations: table.columns
.map(col => col.operation.label)
.join(
i18n.translate('xpack.lens.datatable.conjunctionSign', {
defaultMessage: ' & ',
description:
'A character that can be used for conjunction of multiple enumarated items. Make sure to include spaces around it if needed.',
})
),
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ export function PopoverEditor(props: PopoverEditorProps) {
/>
)}
{!incompatibleSelectedOperationType && selectedColumn && (
<EuiFormRow label="Label">
<EuiFormRow
label={i18n.translate('xpack.lens.indexPattern.columnLabel', {
defaultMessage: 'Label',
description: 'Label of a column of data',
})}
>
<EuiFieldText
data-test-subj="indexPattern-label-edit"
value={selectedColumn.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import { partition } from 'lodash';
import { Position } from '@elastic/charts';
import {
Expand Down Expand Up @@ -95,13 +96,31 @@ function getSuggestion(
splitBy?: TableSuggestionColumn,
currentState?: State
): VisualizationSuggestion<State> {
const yTitle = yValues.map(col => col.operation.label).join(' & ');
const yTitle = yValues
.map(col => col.operation.label)
.join(
i18n.translate('xpack.lens.xySuggestions.yAxixConjunctionSign', {
defaultMessage: ' & ',
description:
'A character that can be used for conjunction of multiple enumarated items. Make sure to include spaces around it if needed.',
})
);
const xTitle = xValue.operation.label;
const isDate = xValue.operation.dataType === 'date';

// TODO: Localize the title, label, etc
const preposition = isDate ? 'over' : 'of';
const title = `${yTitle} ${preposition} ${xTitle}`;
const title = isDate
? i18n.translate('xpack.lens.xySuggestions.dateSuggestion', {
defaultMessage: '{yTitle} over {xTitle}',
description:
'Chart description for charts over time, like "Transfered bytes over log.timestamp"',
values: { xTitle, yTitle },
})
: i18n.translate('xpack.lens.xySuggestions.nonDateSuggestion', {
defaultMessage: '{yTitle} of {xTitle}',
description:
'Chart description for a value of some groups, like "Top URLs of top 5 countries"',
values: { xTitle, yTitle },
});
const seriesType: SeriesType =
(currentState && currentState.preferredSeriesType) || (splitBy && isDate ? 'line' : 'bar');
const state: State = {
Expand Down