[i18n] Translate missed labels in src/ui folder (#29614)

* Translate missed labels

* Resolve review comment

* Add missed translation
This commit is contained in:
Nox911 2019-01-31 17:56:13 +03:00 committed by GitHub
parent 779c9e1fd3
commit 6303731052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 10 deletions

View file

@ -25,6 +25,8 @@ import { NotificationsStartContract } from '../notifications';
import { UiSettingsApi } from './ui_settings_api';
import { UiSettingsClient } from './ui_settings_client';
import { i18n } from '@kbn/i18n';
interface Deps {
notifications: NotificationsStartContract;
loadingCount: LoadingCountStartContract;
@ -47,7 +49,9 @@ export class UiSettingsService {
api: this.uiSettingsApi,
onUpdateError: error => {
notifications.toasts.addDanger({
title: 'Unable to update UI setting',
title: i18n.translate('core.uiSettings.unableUpdateUISettingNotificationMessageTitle', {
defaultMessage: 'Unable to update UI setting',
}),
text: error.message,
});
},

View file

@ -108,10 +108,15 @@ export const termsBucketAgg = new BucketAggType({
const filterAgg = buildOtherBucketAgg(aggConfigs, aggConfig, resp);
nestedSearchSource.setField('aggs', filterAgg);
const request = inspectorAdapters.requests.start('Other bucket', {
description: `This request counts the number of documents that fall
outside the criterion of the data buckets.`
});
const request = inspectorAdapters.requests.start(
i18n.translate('common.ui.aggTypes.buckets.terms.otherBucketTitle', { defaultMessage: 'Other bucket' }),
{
description: i18n.translate('common.ui.aggTypes.buckets.terms.otherBucketDescription', {
defaultMessage: 'This request counts the number of documents that fall ' +
'outside the criterion of the data buckets.'
}),
}
);
nestedSearchSource.getSearchRequestBody().then(body => {
request.json(body);
});
@ -161,7 +166,9 @@ export const termsBucketAgg = new BucketAggType({
try {
return agg.makeLabel();
} catch (e) {
return '- agg not valid -';
return i18n.translate('common.ui.aggTypes.buckets.terms.aggNotValidLabel', {
defaultMessage: '- agg not valid -',
});
}
};

View file

@ -39,7 +39,7 @@
<td>
<button
type="button"
aria-label="Remove this range"
aria-label="{{ ::'common.ui.aggTypes.ranges.removeRangeButtonAriaLabel' | i18n: { defaultMessage: 'Remove this range' } }}"
ng-click="agg.params.ranges.splice($index, 1)"
class="kuiButton kuiButton--danger kuiButton--small">
<i class="fa fa-times"></i>

View file

@ -85,10 +85,14 @@
ng-if="notif.isTimed()"
class="kbnToaster__countdown"
ng-click="notif.cancelTimer()"
title="Stop"
title="{{ ::'common.ui.notify.toaster.stopCountdownButtonTooltip' | i18n: { defaultMessage: 'Stop' } }}"
>
<span class="euiBadge__content">
<span> {{ notif.timeRemaining }}s </span>
<span
i18n-id="common.ui.notify.toaster.timeRemainingInSecondsLabel"
i18n-default-message="{timeRemaining}s"
i18n-values="{ timeRemaining: notif.timeRemaining }"
></span>
</span>
</button>
</div>

View file

@ -1,3 +1,11 @@
<div class="kuiToolBarText" data-test-subj="toolBarPagerText">
{{ toolBarPagerText.startItem | number }}&ndash;{{ toolBarPagerText.endItem | number }} of {{ toolBarPagerText.totalItems | number }}
<span
i18n-id="common.ui.pagerControl.pagesCountLabel"
i18n-default-message="{startItem}&ndash;{endItem} of {totalItems}"
i18n-values="{
startItem: (toolBarPagerText.startItem | number),
endItem: (toolBarPagerText.endItem | number),
totalItems: (toolBarPagerText.totalItems | number)
}"
></span>
</div>