-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Discover translations #24079
Discover translations #24079
Changes from 2 commits
9e6c546
035e1aa
a80f58a
eaf9147
5925e54
5416832
ca2af5e
2fba3f3
9567b07
e953eac
af732e3
0b0fb6a
0aac7fb
809286a
25c0b4c
b1ffeae
526efd0
8f04388
182c246
b1707b6
48e5c51
8359381
95d8929
d8fba05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<section class="sidebar-list" aria-label="Index and fields"> | ||
<section class="sidebar-list" aria-label="{{::'kbn.discover.fieldChooser.indexAndFieldsSectionAriaLabel' | i18n: {defaultMessage: 'Index and fields'} }}"> | ||
<div ng-show="indexPatternList.length > 1"> | ||
<ui-select | ||
class="index-pattern-selection" | ||
|
@@ -32,9 +32,13 @@ | |
</div> | ||
|
||
<div class="dscSidebar__listHeader sidebar-list-header" ng-if="fields.length"> | ||
<h3 class="sidebar-list-header-label" id="selected_fields" tabindex="0"> | ||
Selected fields | ||
</h3> | ||
<h3 | ||
class="sidebar-list-header-label" | ||
id="selected_fields" | ||
tabindex="0" | ||
i18n-id="kbn.discover.fieldChooser.selectedFieldsTitle" | ||
i18n-default-message="Selected fields" | ||
></h3> | ||
</div> | ||
<ul class="list-unstyled dscFieldList--selected" > | ||
<discover-field | ||
|
@@ -49,9 +53,13 @@ <h3 class="sidebar-list-header-label" id="selected_fields" tabindex="0"> | |
</ul> | ||
|
||
<div class="sidebar-list-header sidebar-item euiFlexGroup euiFlexGroup--gutterMedium" ng-if="fields.length"> | ||
<h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex="0"> | ||
Available fields | ||
</h3> | ||
<h3 | ||
class="euiFlexItem sidebar-list-header-label" | ||
id="available_fields" | ||
tabindex="0" | ||
i18n-id="kbn.discover.fieldChooser.availableFieldsTitle" | ||
i18n-default-message="Available fields" | ||
></h3> | ||
|
||
<div class="euiFlexItem euiFlexItem--flexGrowZero"> | ||
<button | ||
|
@@ -72,7 +80,7 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
ng-class="{ 'kuiButton--basic': !filter.active, 'kuiButton--primary': filter.active, 'hidden-xs': !$parent.showFields, 'hidden-sm': !$parent.showFields }" | ||
class="kuiButton kuiButton--small pull-right discover-field-filter-toggle" | ||
ng-click="$parent.showFilter = !$parent.showFilter" | ||
aria-label="{{$parent.showFilter ? 'Hide' : 'Show'}} field settings" | ||
aria-label="{{toggleFieldFilterButtonAriaLabel}}" | ||
aria-expanded="{{!!$parent.showFilter}}" | ||
aria-controls="discoverFieldFilter" | ||
data-test-subj="toggleFieldFilterButton" | ||
|
@@ -85,9 +93,11 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
<div class="sidebar-item dscFieldDetails" ng-show="showFilter" id="discoverFieldFilter" data-test-subj="discoverFieldFilter"> | ||
<form role="form"> | ||
<div class="form-group"> | ||
<label for="discoverFieldChooserFilterAggregatable"> | ||
Aggregatable | ||
</label> | ||
<label | ||
for="discoverFieldChooserFilterAggregatable" | ||
i18n-id="kbn.discover.fieldChooser.aggregatableLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser.aggregatableLabel => kbn.discover.fieldChooser.filter.aggregatableLabel |
||
i18n-default-message="Aggregatable" | ||
></label> | ||
<select | ||
id="discoverFieldChooserFilterAggregatable" | ||
ng-options="opt.value as opt.label for opt in filter.boolOpts" | ||
|
@@ -96,9 +106,11 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
</select> | ||
</div> | ||
<div class="form-group"> | ||
<label for="discoverFieldChooserFilterSearchable"> | ||
Searchable | ||
</label> | ||
<label | ||
for="discoverFieldChooserFilterSearchable" | ||
i18n-id="kbn.discover.fieldChooser.searchableLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser. => kbn.discover.fieldChooser.filter. |
||
i18n-default-message="Searchable" | ||
></label> | ||
<select | ||
id="discoverFieldChooserFilterSearchable" | ||
ng-options="opt.value as opt.label for opt in filter.boolOpts" | ||
|
@@ -107,9 +119,11 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
</select> | ||
</div> | ||
<div class="form-group"> | ||
<label for="discoverFieldChooserFilterType"> | ||
Type | ||
</label> | ||
<label | ||
for="discoverFieldChooserFilterType" | ||
i18n-id="kbn.discover.fieldChooser.typeLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser. => kbn.discover.fieldChooser.filter. |
||
i18n-default-message="Type" | ||
></label> | ||
<select | ||
id="discoverFieldChooserFilterType" | ||
ng-options="field as field for field in fieldTypes" | ||
|
@@ -118,9 +132,11 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
</select> | ||
</div> | ||
<div class="form-group"> | ||
<label for="discoverFieldChooserFilterFieldName"> | ||
Field name | ||
</label> | ||
<label | ||
for="discoverFieldChooserFilterFieldName" | ||
i18n-id="kbn.discover.fieldChooser.fieldNameLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser. => kbn.discover.fieldChooser.filter. |
||
i18n-default-message="Field name" | ||
></label> | ||
<input | ||
id="discoverFieldChooserFilterFieldName" | ||
type="text" | ||
|
@@ -129,18 +145,19 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
> | ||
</div> | ||
<div class="form-group"> | ||
<label for="discoverFieldChooserHideMissingFields"> | ||
<input id="discoverFieldChooserHideMissingFields" type="checkbox" ng-model="filter.vals.missing"> | ||
Hide missing fields | ||
</label> | ||
<label for="discoverFieldChooserHideMissingFields" | ||
i18n-id="kbn.discover.fieldChooser.hideMissingFieldsLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser. => kbn.discover.fieldChooser.filter. |
||
i18n-default-message="{input} Hide missing fields" | ||
i18n-values="{ input: '<input id=\'discoverFieldChooserHideMissingFields\' type=\'checkbox\' ng-model=\'filter.vals.missing\'></label>'}" | ||
></label> | ||
</div> | ||
<button | ||
ng-click="filter.reset()" | ||
ng-disabled="!filter.active" | ||
class="kuiButton kuiButton--danger kuiButton--fullWidth" | ||
> | ||
Reset filters | ||
</button> | ||
i18n-id="kbn.discover.fieldChooser.resetFiltersButtonLabel" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kbn.discover.fieldChooser. => kbn.discover.fieldChooser.filter. |
||
i18n-default-message="Reset filters" | ||
></button> | ||
</form> | ||
</div> | ||
|
||
|
@@ -149,7 +166,10 @@ <h3 class="euiFlexItem sidebar-list-header-label" id="available_fields" tabindex | |
ng-class="{ 'hidden-sm': !showFields, 'hidden-xs': !showFields }" | ||
class="list-unstyled sidebar-well dscFieldList--popular"> | ||
<li class="sidebar-item sidebar-list-header"> | ||
<h6>Popular</h6> | ||
<h6 | ||
i18n-id="kbn.discover.fieldChooser.popularTitle" | ||
i18n-default-message="Popular" | ||
></h6> | ||
</li> | ||
<discover-field | ||
ng-repeat="field in popularFields | filter:filter.isFieldFiltered" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<div class="dscFieldDetails"> | ||
<div class="kuiVerticalRhythmSmall"> | ||
<p class="euiText euiText--extraSmall euiTextColor--subdued" ng-show="!field.details.error"> | ||
Top 5 values in | ||
<span | ||
i18n-id="kbn.discover.fieldChooser.detailViews.topValuesInRecordsDescription" | ||
i18n-default-message="Top 5 values in" | ||
></span> | ||
<span ng-if="!field.details.error"> | ||
<a | ||
class="kuiLink" | ||
|
@@ -14,7 +17,11 @@ | |
ng-show="field.indexPattern.metaFields.includes(field.name) || field.scripted"> | ||
{{::field.details.exists}} | ||
</span> | ||
/ {{::field.details.total}} records | ||
/ {{::field.details.total}} | ||
<span | ||
i18n-id="kbn.discover.fieldChooser.detailViews.recordsText" | ||
i18n-default-message="records" | ||
></span> | ||
</span> | ||
</p> | ||
|
||
|
@@ -30,9 +37,14 @@ | |
css-truncate | ||
css-truncate-expandable="true" | ||
class="dscFieldDetails__value" | ||
aria-label="Value: {{:: bucket.display === '' ? 'Empty string' : bucket.display }}" | ||
aria-label="{{bucketAriaLabel}}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use bind once here. |
||
> | ||
{{::bucket.display}} <em ng-show="bucket.display === ''">Empty string</em> | ||
{{::bucket.display}} | ||
<em | ||
ng-show="bucket.display === ''" | ||
i18n-id="kbn.discover.fieldChooser.detailViews.emptyStringText" | ||
i18n-default-message="Empty string" | ||
></em> | ||
</div> | ||
|
||
<!-- Add/remove filter buttons --> | ||
|
@@ -43,7 +55,7 @@ | |
<button | ||
class="dscFieldDetailsItem__button" | ||
ng-click="onAddFilter(field, bucket.value, '+')" | ||
aria-label="Filter for this value" | ||
aria-label="{{::'kbn.discover.fieldChooser.detailViews.filterValueButtonAriaLabel' | i18n: {defaultMessage: 'Filter for this value'} }}" | ||
data-test-subj="plus-{{::field.name}}-{{::bucket.display}}" | ||
> | ||
<span | ||
|
@@ -55,7 +67,7 @@ | |
<button | ||
class="dscFieldDetailsItem__button" | ||
ng-click="onAddFilter(field, bucket.value, '-')" | ||
aria-label="Filter out this value" | ||
aria-label="{{::'kbn.discover.fieldChooser.detailViews.filterOutValueButtonAriaLabel' | i18n: {defaultMessage: 'Filter out this value'} }}" | ||
data-test-subj="minus-{{::field.name}}-{{::bucket.display}}" | ||
> | ||
<span | ||
|
@@ -84,9 +96,16 @@ | |
class="kuiButton kuiButton--secondary kuiButton--small kuiButton--fullWidth kuiVerticalRhythmSmall" | ||
data-test-subj="fieldVisualize-{{::field.name}}" | ||
> | ||
Visualize | ||
<span | ||
i18n-id="kbn.discover.fieldChooser.detailViews.visualizeLinkText" | ||
i18n-default-message="Visualize" | ||
></span> | ||
<span class="discover-field-vis-warning" ng-show="warnings.length" tooltip="{{warnings.join(' ')}}"> | ||
( {{::warnings.length}} <ng-pluralize count="warnings.length" when="{'1':'warning', 'other':'warnings'}"></ng-pluralize> <i aria-hidden="true" class="fa fa-warning"></i> ) | ||
( {{::warnings.length}} <span | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can display
|
||
i18n-id="kbn.discover.fieldChooser.detailViews.warningsText" | ||
i18n-default-message="{warningsLength, plural, one {warning} other {warnings}}" | ||
i18n-values="{ warningsLength: warnings.length }" | ||
></span> <i aria-hidden="true" class="fa fa-warning"></i> ) | ||
</span> | ||
</a> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
*/ | ||
|
||
import _ from 'lodash'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
function getFieldValues(hits, field) { | ||
const name = field.name; | ||
|
@@ -38,7 +39,9 @@ function getFieldValueCounts(params) { | |
|| params.field.type === 'geo_shape' | ||
|| params.field.type === 'attachment' | ||
) { | ||
return { error: 'Analysis is not available for geo fields.' }; | ||
return { error: i18n.translate('kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForGeoFieldsErrorMessage', { | ||
defaultMessage: 'Analysis is not available for geo fields.', | ||
}) }; | ||
} | ||
|
||
const allValues = getFieldValues(params.hits, params.field); | ||
|
@@ -59,9 +62,13 @@ function getFieldValueCounts(params) { | |
|
||
if (params.hits.length - missing === 0) { | ||
return { | ||
error: 'This field is present in your Elasticsearch mapping' + | ||
' but not in the ' + params.hits.length + ' documents shown in the doc table.' + | ||
' You may still be able to visualize or search on it.' | ||
error: i18n.translate('kbn.discover.fieldChooser.fieldCalculator.fieldIsNorPresentInDocumentsErrorMessage', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .fieldIsNorPresentInDocumentsErrorMessage => .fieldIsNotPresentInDocumentsErrorMessage |
||
defaultMessage: 'This field is present in your Elasticsearch mapping \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please place string in one line, disable eslint rule if it's needed. |
||
but not in the {hitsLength} documents shown in the doc table. You may still be able to visualize or search on it.', | ||
values: { | ||
hitsLength: params.hits.length, | ||
}, | ||
}) | ||
}; | ||
} | ||
|
||
|
@@ -89,7 +96,9 @@ function _groupValues(allValues, params) { | |
|
||
allValues.forEach(function (value) { | ||
if (_.isObject(value) && !Array.isArray(value)) { | ||
throw new Error('Analysis is not available for object fields'); | ||
throw new Error(i18n.translate('kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForObjectFieldsErrorMessage', { | ||
defaultMessage: 'Analysis is not available for object fields.', | ||
})); | ||
} | ||
|
||
if (Array.isArray(value) && !params.grouped) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move
‘
and’
tofetchErrorScript
value and align default message: