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

Translations for Table Vis plugin #23679

Merged
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"kbn": "src/core_plugins/kibana",
"markdownVis": "src/core_plugins/markdown_vis",
"metricVis": "src/core_plugins/metric_vis",
"tableVis": "src/core_plugins/table_vis",
"statusPage": "src/core_plugins/status_page",
"xpack.idxMgmt": "x-pack/plugins/index_management"
},
Expand Down
5 changes: 4 additions & 1 deletion src/core_plugins/table_vis/public/table_vis.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div ng-controller="KbnTableVisController" class="table-vis">
<div ng-if="!hasSomeRows && hasSomeRows !== null" class="table-vis-error">
<h2 aria-hidden="true"><i aria-hidden="true" class="fa fa-meh-o"></i></h2>
<h4>No results found</h4>
<h4
i18n-id="tableVis.vis.noResultsFoundTitle"
i18n-default-message="No results found"
></h4>
</div>

<div ng-if="tableGroups" class="table-vis-container" data-test-subj="tableVis">
Expand Down
21 changes: 16 additions & 5 deletions src/core_plugins/table_vis/public/table_vis.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';
pavel06081991 marked this conversation as resolved.
Show resolved Hide resolved
import './table_vis.less';
import './table_vis_controller';
import './table_vis_params';
Expand Down Expand Up @@ -50,9 +51,13 @@ function TableVisTypeProvider(Private) {
return VisFactory.createAngularVisualization({
type: 'table',
name: 'table',
title: 'Data Table',
title: i18n.translate('tableVis.vis.tableVisTitle', {
pavel06081991 marked this conversation as resolved.
Show resolved Hide resolved
defaultMessage: 'Data Table',
}),
icon: 'visTable',
description: 'Display values in a table',
description: i18n.translate('tableVis.vis.tableVisDescription', {
defaultMessage: 'Display values in a table',
}),
category: CATEGORY.DATA,
visConfig: {
defaults: {
Expand All @@ -74,7 +79,9 @@ function TableVisTypeProvider(Private) {
{
group: 'metrics',
name: 'metric',
title: 'Metric',
title: i18n.translate('tableVis.vis.tableVisEditorConfig.schemas.metricTitle', {
defaultMessage: 'Metric',
}),
aggFilter: ['!geo_centroid', '!geo_bounds'],
min: 1,
defaults: [
Expand All @@ -84,13 +91,17 @@ function TableVisTypeProvider(Private) {
{
group: 'buckets',
name: 'bucket',
title: 'Split Rows',
title: i18n.translate('tableVis.vis.tableVisEditorConfig.schemas.bucketTitle', {
defaultMessage: 'Split Rows',
}),
aggFilter: ['!filter']
},
{
group: 'buckets',
name: 'split',
title: 'Split Table',
title: i18n.translate('tableVis.vis.tableVisEditorConfig.schemas.splitTitle', {
defaultMessage: 'Split Table',
}),
aggFilter: ['!filter']
}
])
Expand Down
48 changes: 30 additions & 18 deletions src/core_plugins/table_vis/public/table_vis_params.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@

<div class="kuiSideBarSection">
<div class="form-group">
<label for="datatableVisualizationPerPage">Per Page</label>
<label
for="datatableVisualizationPerPage"
i18n-id="tableVis.params.perPageLabel"
i18n-default-message="Per Page"
></label>
<input type="number" ng-model="editorState.params.perPage" class="form-control" id="datatableVisualizationPerPage">
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="editorState.params.showMetricsAtAllLevels">
Show metrics for every bucket/level
</label>
<label
i18n-id="tableVis.params.showMetricsLabel"
i18n-default-message="{input} Show metrics for every bucket/level"
i18n-values="{ input: '<input type=\'checkbox\' ng-model=\'editorState.params.showMetricsAtAllLevels\'>' }"
></label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="editorState.params.showPartialRows">
Show partial rows
</label>
<label
i18n-id="tableVis.params.showPartialRowsLabel"
i18n-default-message="{input} Show partial rows"
i18n-values="{ input: '<input type=\'checkbox\' ng-model=\'editorState.params.showPartialRows\'>' }"
></label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="metricsAtAllLevels" disabled>
Calculate metrics for every bucket/level
</label>
<label
i18n-id="tableVis.params.calculateMetricsLabel"
i18n-default-message="{input} Calculate metrics for every bucket/level"
i18n-values="{ input: '<input type=\'checkbox\' ng-model=\'metricsAtAllLevels\' disabled>' }"
></label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="editorState.params.showTotal">
Show total
</label>
<label
i18n-id="tableVis.params.showTotalLabel"
i18n-default-message="{input} Show total"
i18n-values="{ input: '<input type=\'checkbox\' ng-model=\'editorState.params.showTotal\'>' }"
></label>
</div>

<div>
<label for="datatableVisualizationTotalFunction">Total function</label>
<label
for="datatableVisualizationTotalFunction"
i18n-id="tableVis.params.totalFunctionLabel"
i18n-default-message="Total function"
></label>
<select ng-disabled="!editorState.params.showTotal"
class="form-control"
ng-model="editorState.params.totalFunc"
Expand Down