Skip to content

Commit

Permalink
Translations for Table Vis plugin (#23679)
Browse files Browse the repository at this point in the history
add translations for table vis plugin
  • Loading branch information
pavel06081991 authored Oct 29, 2018
1 parent 9850f11 commit b3bc86d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"kbnVislibVisTypes": "src/core_plugins/kbn_vislib_vis_types",
"markdownVis": "src/core_plugins/markdown_vis",
"metricVis": "src/core_plugins/metric_vis",
"tableVis": "src/core_plugins/table_vis",
"regionMap": "src/core_plugins/region_map",
"statusPage": "src/core_plugins/status_page",
"tileMap": "src/core_plugins/tile_map",
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';
import './table_vis_controller';
import './table_vis_params';
import 'ui/agg_table';
Expand Down Expand Up @@ -51,9 +52,13 @@ function TableVisTypeProvider(Private) {
return VisFactory.createAngularVisualization({
type: 'table',
name: 'table',
title: 'Data Table',
title: i18n.translate('tableVis.tableVisTitle', {
defaultMessage: 'Data Table',
}),
icon: 'visTable',
description: 'Display values in a table',
description: i18n.translate('tableVis.tableVisDescription', {
defaultMessage: 'Display values in a table',
}),
category: CATEGORY.DATA,
visConfig: {
defaults: {
Expand All @@ -75,7 +80,9 @@ function TableVisTypeProvider(Private) {
{
group: 'metrics',
name: 'metric',
title: 'Metric',
title: i18n.translate('tableVis.tableVisEditorConfig.schemas.metricTitle', {
defaultMessage: 'Metric',
}),
aggFilter: ['!geo_centroid', '!geo_bounds'],
min: 1,
defaults: [
Expand All @@ -85,13 +92,17 @@ function TableVisTypeProvider(Private) {
{
group: 'buckets',
name: 'bucket',
title: 'Split Rows',
title: i18n.translate('tableVis.tableVisEditorConfig.schemas.bucketTitle', {
defaultMessage: 'Split Rows',
}),
aggFilter: ['!filter']
},
{
group: 'buckets',
name: 'split',
title: 'Split Table',
title: i18n.translate('tableVis.tableVisEditorConfig.schemas.splitTitle', {
defaultMessage: 'Split Table',
}),
aggFilter: ['!filter']
}
])
Expand Down
32 changes: 26 additions & 6 deletions src/core_plugins/table_vis/public/table_vis_params.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@

<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" data-test-subj="showMetricsAtAllLevels">
Show metrics for every bucket/level
<span
i18n-id="tableVis.params.showMetricsLabel"
i18n-default-message="Show metrics for every bucket/level"
></span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="editorState.params.showPartialRows">
Show partial rows
<span
i18n-id="tableVis.params.showPartialRowsLabel"
i18n-default-message="Show partial rows"
></span>
</label>
</div>

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

<div class="checkbox">
<label>
<input type="checkbox" ng-model="editorState.params.showTotal">
Show total
<span
i18n-id="tableVis.params.showTotalLabel"
i18n-default-message="Show total"
></span>
</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

0 comments on commit b3bc86d

Please sign in to comment.