* Translate missings labels in dev tools and management * Fix issues * Add translation for k7Breadcrumbs
This commit is contained in:
parent
1978cd2c31
commit
b7af462dc0
|
@ -32,11 +32,15 @@ uiRoutes
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
FeatureCatalogueRegistryProvider.register(() => {
|
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||||
return {
|
return {
|
||||||
id: 'console',
|
id: 'console',
|
||||||
title: 'Console',
|
title: i18n('kbn.devTools.consoleTitle', {
|
||||||
description: 'Skip cURL and use this JSON interface to work with your data directly.',
|
defaultMessage: 'Console'
|
||||||
|
}),
|
||||||
|
description: i18n('kbn.devTools.consoleDescription', {
|
||||||
|
defaultMessage: 'Skip cURL and use this JSON interface to work with your data directly.'
|
||||||
|
}),
|
||||||
icon: 'consoleApp',
|
icon: 'consoleApp',
|
||||||
path: '/app/kibana#/dev_tools/console',
|
path: '/app/kibana#/dev_tools/console',
|
||||||
showOnHomePage: true,
|
showOnHomePage: true,
|
||||||
|
|
|
@ -86,11 +86,15 @@ uiModules
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
FeatureCatalogueRegistryProvider.register(() => {
|
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||||
return {
|
return {
|
||||||
id: 'management',
|
id: 'management',
|
||||||
title: 'Management',
|
title: i18n('kbn.management.managementLabel', {
|
||||||
description: 'Your center console for managing the Elastic Stack.',
|
defaultMessage: 'Management',
|
||||||
|
}),
|
||||||
|
description: i18n('kbn.management.managementDescription', {
|
||||||
|
defaultMessage: 'Your center console for managing the Elastic Stack.',
|
||||||
|
}),
|
||||||
icon: 'managementApp',
|
icon: 'managementApp',
|
||||||
path: '/app/kibana#/management',
|
path: '/app/kibana#/management',
|
||||||
showOnHomePage: false,
|
showOnHomePage: false,
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Header } from '../header';
|
import { Header } from '../header';
|
||||||
import { shallow } from 'enzyme';
|
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
|
|
||||||
describe('Header', () => {
|
describe('Header', () => {
|
||||||
it('should render normally', () => {
|
it('should render normally', () => {
|
||||||
const component = shallow(
|
const component = shallowWithIntl(
|
||||||
<Header
|
<Header.WrappedComponent
|
||||||
isIncludingSystemIndices={true}
|
isIncludingSystemIndices={true}
|
||||||
onChangeIncludingSystemIndices={() => {}}
|
onChangeIncludingSystemIndices={() => {}}
|
||||||
/>
|
/>
|
||||||
|
@ -34,8 +34,8 @@ describe('Header', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render without including system indices', () => {
|
it('should render without including system indices', () => {
|
||||||
const component = shallow(
|
const component = shallowWithIntl(
|
||||||
<Header
|
<Header.WrappedComponent
|
||||||
isIncludingSystemIndices={false}
|
isIncludingSystemIndices={false}
|
||||||
onChangeIncludingSystemIndices={() => {}}
|
onChangeIncludingSystemIndices={() => {}}
|
||||||
/>
|
/>
|
||||||
|
@ -45,8 +45,8 @@ describe('Header', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a different name, prompt, and beta tag if provided', () => {
|
it('should render a different name, prompt, and beta tag if provided', () => {
|
||||||
const component = shallow(
|
const component = shallowWithIntl(
|
||||||
<Header
|
<Header.WrappedComponent
|
||||||
isIncludingSystemIndices={false}
|
isIncludingSystemIndices={false}
|
||||||
onChangeIncludingSystemIndices={() => {}}
|
onChangeIncludingSystemIndices={() => {}}
|
||||||
prompt={<div>Test prompt</div>}
|
prompt={<div>Test prompt</div>}
|
||||||
|
|
|
@ -30,15 +30,16 @@ import {
|
||||||
EuiSwitch,
|
EuiSwitch,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
|
|
||||||
import { FormattedMessage } from '@kbn/i18n/react';
|
import { FormattedMessage, injectI18n } from '@kbn/i18n/react';
|
||||||
|
|
||||||
export const Header = ({
|
const HeaderUi = ({
|
||||||
prompt,
|
prompt,
|
||||||
indexPatternName,
|
indexPatternName,
|
||||||
showSystemIndices,
|
showSystemIndices,
|
||||||
isIncludingSystemIndices,
|
isIncludingSystemIndices,
|
||||||
onChangeIncludingSystemIndices,
|
onChangeIncludingSystemIndices,
|
||||||
isBeta,
|
isBeta,
|
||||||
|
intl
|
||||||
}) => (
|
}) => (
|
||||||
<div>
|
<div>
|
||||||
<EuiTitle>
|
<EuiTitle>
|
||||||
|
@ -53,7 +54,12 @@ export const Header = ({
|
||||||
{ isBeta ? (
|
{ isBeta ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{' '}
|
{' '}
|
||||||
<EuiBetaBadge label="Beta" />
|
<EuiBetaBadge
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'kbn.management.createIndexPattern.betaLabel',
|
||||||
|
defaultMessage: 'Beta'
|
||||||
|
})}
|
||||||
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : null }
|
) : null }
|
||||||
</h1>
|
</h1>
|
||||||
|
@ -98,3 +104,5 @@ export const Header = ({
|
||||||
<EuiSpacer size="m"/>
|
<EuiSpacer size="m"/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const Header = injectI18n(HeaderUi);
|
||||||
|
|
|
@ -31,7 +31,7 @@ exports[`LoadingIndices should render normally 1`] = `
|
||||||
component="span"
|
component="span"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Looking for matching indices..."
|
defaultMessage="Looking for matching indices…"
|
||||||
id="kbn.management.createIndexPattern.step.loadingHeader"
|
id="kbn.management.createIndexPattern.step.loadingHeader"
|
||||||
values={Object {}}
|
values={Object {}}
|
||||||
/>
|
/>
|
||||||
|
@ -51,7 +51,7 @@ exports[`LoadingIndices should render normally 1`] = `
|
||||||
component="span"
|
component="span"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Just a sec..."
|
defaultMessage="Just a sec…"
|
||||||
id="kbn.management.createIndexPattern.step.loadingLabel"
|
id="kbn.management.createIndexPattern.step.loadingLabel"
|
||||||
values={Object {}}
|
values={Object {}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -44,7 +44,7 @@ export const LoadingIndices = ({ ...rest }) => (
|
||||||
<EuiTextColor color="subdued">
|
<EuiTextColor color="subdued">
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="kbn.management.createIndexPattern.step.loadingHeader"
|
id="kbn.management.createIndexPattern.step.loadingHeader"
|
||||||
defaultMessage="Looking for matching indices..."
|
defaultMessage="Looking for matching indices…"
|
||||||
/>
|
/>
|
||||||
</EuiTextColor>
|
</EuiTextColor>
|
||||||
</EuiText>
|
</EuiText>
|
||||||
|
@ -53,7 +53,7 @@ export const LoadingIndices = ({ ...rest }) => (
|
||||||
<EuiTextColor color="subdued">
|
<EuiTextColor color="subdued">
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="kbn.management.createIndexPattern.step.loadingLabel"
|
id="kbn.management.createIndexPattern.step.loadingLabel"
|
||||||
defaultMessage="Just a sec..."
|
defaultMessage="Just a sec…"
|
||||||
/>
|
/>
|
||||||
</EuiTextColor>
|
</EuiTextColor>
|
||||||
</EuiText>
|
</EuiText>
|
||||||
|
|
|
@ -46,7 +46,7 @@ exports[`StepTimeField should render a loading state when creating the index pat
|
||||||
size="m"
|
size="m"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Creating index pattern..."
|
defaultMessage="Creating index pattern…"
|
||||||
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
||||||
values={Object {}}
|
values={Object {}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -68,7 +68,7 @@ exports[`TimeField should render a loading state 1`] = `
|
||||||
options={
|
options={
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
"text": "Loading...",
|
"text": "Loading…",
|
||||||
"value": "",
|
"value": "",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
@ -100,7 +100,7 @@ export const TimeFieldComponent = ({
|
||||||
{
|
{
|
||||||
text: intl.formatMessage({
|
text: intl.formatMessage({
|
||||||
id: 'kbn.management.createIndexPattern.stepTime.field.loadingDropDown',
|
id: 'kbn.management.createIndexPattern.stepTime.field.loadingDropDown',
|
||||||
defaultMessage: 'Loading...'
|
defaultMessage: 'Loading…'
|
||||||
}),
|
}),
|
||||||
value: ''
|
value: ''
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ export class StepTimeFieldComponent extends Component {
|
||||||
<EuiText>
|
<EuiText>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
||||||
defaultMessage="Creating index pattern..."
|
defaultMessage="Creating index pattern…"
|
||||||
/>
|
/>
|
||||||
</EuiText>
|
</EuiText>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
|
|
|
@ -33,6 +33,8 @@ import {
|
||||||
rgbToHex,
|
rgbToHex,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
|
|
||||||
|
import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
|
|
||||||
export class CreateButton extends Component {
|
export class CreateButton extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -64,7 +66,12 @@ export class CreateButton extends Component {
|
||||||
renderBetaBadge = () => {
|
renderBetaBadge = () => {
|
||||||
const color = rgbToHex(euiColorAccent);
|
const color = rgbToHex(euiColorAccent);
|
||||||
return (
|
return (
|
||||||
<EuiBadge color={color}>Beta</EuiBadge>
|
<EuiBadge color={color}>
|
||||||
|
<FormattedMessage
|
||||||
|
id="kbn.management.indexPatternList.createButton.betaLabel"
|
||||||
|
defaultMessage="Beta"
|
||||||
|
/>
|
||||||
|
</EuiBadge>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import { getIndexBreadcrumbs } from './breadcrumbs';
|
||||||
|
|
||||||
const REACT_OBJECTS_TABLE_DOM_ELEMENT_ID = 'reactSavedObjectsTable';
|
const REACT_OBJECTS_TABLE_DOM_ELEMENT_ID = 'reactSavedObjectsTable';
|
||||||
|
|
||||||
function updateObjectsTable($scope, $injector) {
|
function updateObjectsTable($scope, $injector, i18n) {
|
||||||
const Private = $injector.get('Private');
|
const Private = $injector.get('Private');
|
||||||
const indexPatterns = $injector.get('indexPatterns');
|
const indexPatterns = $injector.get('indexPatterns');
|
||||||
const $http = $injector.get('$http');
|
const $http = $injector.get('$http');
|
||||||
|
@ -70,7 +70,10 @@ function updateObjectsTable($scope, $injector) {
|
||||||
}
|
}
|
||||||
const serviceName = typeToServiceName(type);
|
const serviceName = typeToServiceName(type);
|
||||||
if (!serviceName) {
|
if (!serviceName) {
|
||||||
toastNotifications.addWarning(`Unknown saved object type: ${type}`);
|
toastNotifications.addWarning(i18n('kbn.management.objects.unknownSavedObjectTypeNotificationMessage', {
|
||||||
|
defaultMessage: 'Unknown saved object type: {type}',
|
||||||
|
values: { type }
|
||||||
|
}));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +109,8 @@ uiModules.get('apps/management')
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
controllerAs: 'managementObjectsController',
|
controllerAs: 'managementObjectsController',
|
||||||
controller: function ($scope, $injector) {
|
controller: function ($scope, $injector, i18n) {
|
||||||
updateObjectsTable($scope, $injector);
|
updateObjectsTable($scope, $injector, i18n);
|
||||||
$scope.$on('$destroy', destroyObjectsTable);
|
$scope.$on('$destroy', destroyObjectsTable);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -164,7 +164,7 @@ class ObjectsTableUI extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
debouncedFetch = debounce(async () => {
|
debouncedFetch = debounce(async () => {
|
||||||
const { savedObjectsClient } = this.props;
|
const { intl, savedObjectsClient } = this.props;
|
||||||
const { activeQuery: query, page, perPage } = this.state;
|
const { activeQuery: query, page, perPage } = this.state;
|
||||||
const { queryText, visibleTypes } = parseQuery(query);
|
const { queryText, visibleTypes } = parseQuery(query);
|
||||||
const findOptions = {
|
const findOptions = {
|
||||||
|
@ -191,7 +191,10 @@ class ObjectsTableUI extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
toastNotifications.addDanger({
|
toastNotifications.addDanger({
|
||||||
title: `Unable find saved objects`,
|
title: intl.formatMessage({
|
||||||
|
id: 'kbn.management.objects.objectsTable.unableFindSavedObjectsNotificationMessage',
|
||||||
|
defaultMessage: 'Unable find saved objects'
|
||||||
|
}),
|
||||||
text: `${error}`,
|
text: `${error}`,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -470,7 +470,13 @@ exports[`Field for boolean setting should render as read only with help text if
|
||||||
checked={false}
|
checked={false}
|
||||||
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
||||||
disabled={true}
|
disabled={true}
|
||||||
label="Off"
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Off"
|
||||||
|
id="kbn.management.settings.field.offLabel"
|
||||||
|
values={Object {}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onKeyDown={[Function]}
|
onKeyDown={[Function]}
|
||||||
/>
|
/>
|
||||||
|
@ -552,7 +558,13 @@ exports[`Field for boolean setting should render custom setting icon if it is cu
|
||||||
checked={true}
|
checked={true}
|
||||||
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
||||||
disabled={false}
|
disabled={false}
|
||||||
label="On"
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="On"
|
||||||
|
id="kbn.management.settings.field.onLabel"
|
||||||
|
values={Object {}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onKeyDown={[Function]}
|
onKeyDown={[Function]}
|
||||||
/>
|
/>
|
||||||
|
@ -623,7 +635,13 @@ exports[`Field for boolean setting should render default value if there is no us
|
||||||
checked={true}
|
checked={true}
|
||||||
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
||||||
disabled={false}
|
disabled={false}
|
||||||
label="On"
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="On"
|
||||||
|
id="kbn.management.settings.field.onLabel"
|
||||||
|
values={Object {}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onKeyDown={[Function]}
|
onKeyDown={[Function]}
|
||||||
/>
|
/>
|
||||||
|
@ -736,7 +754,13 @@ exports[`Field for boolean setting should render user value if there is user val
|
||||||
checked={false}
|
checked={false}
|
||||||
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
data-test-subj="advancedSetting-editField-boolean:test:setting"
|
||||||
disabled={false}
|
disabled={false}
|
||||||
label="Off"
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Off"
|
||||||
|
id="kbn.management.settings.field.offLabel"
|
||||||
|
values={Object {}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
onKeyDown={[Function]}
|
onKeyDown={[Function]}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -354,7 +354,17 @@ class FieldUI extends PureComponent {
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
return (
|
return (
|
||||||
<EuiSwitch
|
<EuiSwitch
|
||||||
label={!!unsavedValue ? 'On' : 'Off'}
|
label={!!unsavedValue ? (
|
||||||
|
<FormattedMessage
|
||||||
|
id="kbn.management.settings.field.onLabel"
|
||||||
|
defaultMessage="On"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<FormattedMessage
|
||||||
|
id="kbn.management.settings.field.offLabel"
|
||||||
|
defaultMessage="Off"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
checked={!!unsavedValue}
|
checked={!!unsavedValue}
|
||||||
onChange={this.onFieldChange}
|
onChange={this.onFieldChange}
|
||||||
disabled={loading || isOverridden}
|
disabled={loading || isOverridden}
|
||||||
|
|
|
@ -85,11 +85,15 @@ management.getSection('kibana').register('settings', {
|
||||||
url: '#/management/kibana/settings'
|
url: '#/management/kibana/settings'
|
||||||
});
|
});
|
||||||
|
|
||||||
FeatureCatalogueRegistryProvider.register(() => {
|
FeatureCatalogueRegistryProvider.register(i18n => {
|
||||||
return {
|
return {
|
||||||
id: 'advanced_settings',
|
id: 'advanced_settings',
|
||||||
title: 'Advanced Settings',
|
title: i18n('kbn.management.settings.advancedSettingsLabel', {
|
||||||
description: 'Directly edit settings that control behavior in Kibana.',
|
defaultMessage: 'Advanced Settings',
|
||||||
|
}),
|
||||||
|
description: i18n('kbn.management.settings.advancedSettingsDescription', {
|
||||||
|
defaultMessage: 'Directly edit settings that control behavior in Kibana.',
|
||||||
|
}),
|
||||||
icon: 'advancedSettingsApp',
|
icon: 'advancedSettingsApp',
|
||||||
path: '/app/kibana#/management/kibana/settings',
|
path: '/app/kibana#/management/kibana/settings',
|
||||||
showOnHomePage: false,
|
showOnHomePage: false,
|
||||||
|
|
Loading…
Reference in a new issue