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 Management -> Objects #23905

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c7ec189
Merge pull request #1 from elastic/master
Nox911 Sep 24, 2018
fa01b88
Merge pull request #2 from elastic/master
Nox911 Sep 27, 2018
70f6c7e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 27, 2018
68587a0
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 28, 2018
42aa7d3
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
efeaefe
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
8a054ed
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 8, 2018
00d1f3e
fix tests and update snapshots
Nox911 Oct 9, 2018
ec91036
fix id names
Nox911 Oct 11, 2018
b0d1660
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 16, 2018
8ce3ea6
fix test and update snapshots
Nox911 Oct 16, 2018
8db403a
Merge branch 'master' into feature/translate-kbn-management-objects
Nox911 Oct 16, 2018
62b6ad1
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 17, 2018
b5dead7
Update unit test snapshots
maryia-lapata Oct 17, 2018
d5d3664
Merge branch 'master' into feature/translate-kbn-management-objects
Nox911 Oct 17, 2018
2791abb
fix issues
Nox911 Oct 18, 2018
acbad4b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 18, 2018
25f2153
Merge branch 'master' into feature/translate-kbn-management-objects
Nox911 Oct 18, 2018
bfe3f1e
Update snapshots
maryia-lapata Oct 18, 2018
8b6d869
Fix issues
Nox911 Oct 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { ObjectsTable } from './components/objects_table';
import { getInAppUrl } from './lib/get_in_app_url';
import { I18nProvider } from '@kbn/i18n/react';

const REACT_OBJECTS_TABLE_DOM_ELEMENT_ID = 'reactSavedObjectsTable';

Expand All @@ -52,31 +53,33 @@ function updateObjectsTable($scope, $injector) {
}

render(
<ObjectsTable
savedObjectsClient={savedObjectsClient}
services={services}
indexPatterns={indexPatterns}
$http={$http}
perPageConfig={config.get('savedObjects:perPage')}
basePath={chrome.getBasePath()}
newIndexPatternUrl={kbnUrl.eval('#/management/kibana/index')}
getEditUrl={(id, type) => {
if (type === 'index-pattern' || type === 'indexPatterns') {
return kbnUrl.eval(`#/management/kibana/indices/${id}`);
}
const serviceName = typeToServiceName(type);
if (!serviceName) {
toastNotifications.addWarning(`Unknown saved object type: ${type}`);
return null;
}
<I18nProvider>
<ObjectsTable
savedObjectsClient={savedObjectsClient}
services={services}
indexPatterns={indexPatterns}
$http={$http}
perPageConfig={config.get('savedObjects:perPage')}
basePath={chrome.getBasePath()}
newIndexPatternUrl={kbnUrl.eval('#/management/kibana/index')}
getEditUrl={(id, type) => {
if (type === 'index-pattern' || type === 'indexPatterns') {
return kbnUrl.eval(`#/management/kibana/indices/${id}`);
}
const serviceName = typeToServiceName(type);
if (!serviceName) {
toastNotifications.addWarning(`Unknown saved object type: ${type}`);
return null;
}

return kbnUrl.eval(`#/management/kibana/objects/${serviceName}/${id}`);
}}
goInApp={(id, type) => {
kbnUrl.change(getInAppUrl(id, type));
$scope.$apply();
}}
/>,
return kbnUrl.eval(`#/management/kibana/objects/${serviceName}/${id}`);
}}
goInApp={(id, type) => {
kbnUrl.change(getInAppUrl(id, type));
$scope.$apply();
}}
/>
</I18nProvider>,
node,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
<!-- Header -->
<div class="kuiViewContentItem kuiBar kuiVerticalRhythm">
<div class="kuiBarSection">
<h1 class="kuiTitle">
Edit {{ title }}
</h1>
<h1
class="kuiTitle"
i18n-id="kbn.management.objects.view.editItemTitle"
i18n-default-message="Edit {title}"
i18n-values="{ title }"
></h1>
</div>

<div class="kuiBarSection">
Expand All @@ -15,7 +18,11 @@ <h1 class="kuiTitle">
>
<span class="kuiButton__inner">
<span class="kuiButton__icon kuiIcon fa-eye"></span>
<span>View {{ title }}</span>
<span
i18n-id="kbn.management.objects.view.viewItemButtonLabel"
i18n-default-message="View {title}"
i18n-values="{ title }"
></span>
</span>
</a>

Expand All @@ -25,7 +32,11 @@ <h1 class="kuiTitle">
>
<span class="kuiButton__inner">
<span class="kuiButton__icon kuiIcon fa-trash-o"></span>
<span>Delete {{ title }}</span>
<span
i18n-id="kbn.management.objects.view.deleteItemButtonLabel"
i18n-default-message="Delete {title}"
i18n-values="{ title }"
></span>
</span>
</button>
</div>
Expand All @@ -39,36 +50,40 @@ <h1 class="kuiTitle">
<div class="kuiInfoPanel kuiInfoPanel--error">
<div class="kuiInfoPanelHeader">
<span class="kuiInfoPanelHeader__icon kuiIcon kuiIcon--error fa-warning"></span>
<span class="kuiInfoPanelHeader__title">
There is a problem with this saved object
</span>
<span
class="kuiInfoPanelHeader__title"
i18n-id="kbn.management.objects.view.savedObjectErrorMessage"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message="There is a problem with this saved object"
></span>
</div>

<div class="kuiInfoPanelBody">
<div
class="kuiInfoPanelBody__message"
ng-if="notFound === 'search'"
>
The saved search associated with this object no longer exists.
</div>
i18n-id="kbn.management.objects.view.savedSearchErrorMessage"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message="The saved search associated with this object no longer exists."
></div>

<div
class="kuiInfoPanelBody__message"
ng-if="notFound === 'index-pattern'"
>
The index pattern associated with this object no longer exists.
</div>
i18n-id="kbn.management.objects.view.indexPatternErrorMessage"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message="The index pattern associated with this object no longer exists."
></div>

<div
class="kuiInfoPanelBody__message"
ng-if="notFound === 'index-pattern-field'"
>
A field associated with this object no longer exists in the index pattern.
</div>
i18n-id="kbn.management.objects.view.indexPatternFieldErrorMessage"
i18n-default-message="A field associated with this object no longer exists in the index pattern.."
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
></div>

<div class="kuiInfoPanelBody__message">
If you know what this error means, go ahead and fix it &mdash; otherwise click the delete button above.
</div>
<div
class="kuiInfoPanelBody__message"
i18n-id="kbn.management.objects.view.errorMessageDescription"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message="If you know what this error means, go ahead and fix it &mdash; otherwise click the delete button above."
></div>
</div>
</div>
</div>
Expand All @@ -78,14 +93,19 @@ <h1 class="kuiTitle">
<div class="kuiInfoPanel kuiInfoPanel--warning">
<div class="kuiInfoPanelHeader">
<span class="kuiInfoPanelHeader__icon kuiIcon kuiIcon--warning fa-bolt"></span>
<span class="kuiInfoPanelHeader__title">
Proceed with caution!
</span>
<span
class="kuiInfoPanelHeader__title"
i18n-id="kbn.management.objects.view.cautionMessageTitle"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message="Proceed with caution!"
></span>
</div>

<div class="kuiInfoPanelBody">
<div class="kuiInfoPanelBody__message">
Modifying objects is for advanced users only. Object properties are not validated and invalid objects could cause errors, data loss, or worse. Unless someone with intimate knowledge of the code told you to be in here, you probably shouldn&rsquo;t be.
<div
class="kuiInfoPanelBody__message"
i18n-id="kbn.management.objects.view.cautionMessageDescription"
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
i18n-default-message=" Modifying objects is for advanced users only. Object properties are not validated and invalid objects could cause errors, data loss, or worse. Unless someone with intimate knowledge of the code told you to be in here, you probably shouldn&rsquo;t be."
>
</div>
</div>
</div>
Expand Down Expand Up @@ -143,20 +163,21 @@ <h1 class="kuiTitle">
<div class="kuiButtonGroup">
<button
class="kuiButton kuiButton--primary"
aria-label="Save {{ title }} Object"
aria-label="{{ 'kbn.management.objects.view.saveButtonAriaLabel' | i18n: { defaultMessage: 'Save { title } Object', values: { title } } }}"
ng-click="submit()"
ng-disabled="objectForm.$invalid || aceInvalidEditors.length !==0"
>
Save {{ title }} Object
</button>
i18n-id="kbn.management.objects.view.saveButtonLabel"
i18n-default-message="Save { title } Object"
i18n-values="{ title }"
></button>

<button
class="kuiButton kuiButton--basic"
aria-label="Cancel"
aria-label="{{ 'kbn.management.objects.view.cancelButtonAriaLabel' | i18n: { defaultMessage: 'Cancel'} }}"
ng-click="cancel()"
>
Cancel
</button>
i18n-id="kbn.management.objects.view.cancelButtonLabel"
i18n-default-message="Cancel"
></button>
</div>
</div>
</kbn-management-objects-view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import _ from 'lodash';
import angular from 'angular';
import rison from 'rison-node';
import { i18n } from '@kbn/i18n';
import { savedObjectManagementRegistry } from '../../saved_object_registry';
import objectViewHTML from './_view.html';
import uiRoutes from 'ui/routes';
Expand Down Expand Up @@ -199,11 +200,17 @@ uiModules.get('apps/management')
}
const confirmModalOptions = {
onConfirm: doDelete,
confirmButtonText: 'Delete',
title: 'Delete saved Kibana object?'
confirmButtonText: i18n.translate('kbn.management.objects.confirmModalOptions.DeleteButtonLabel', {
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
defaultMessage: 'Delete',
}),
title: i18n.translate('kbn.management.objects.confirmModalOptions.DeleteButtonTitle', {
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
defaultMessage: 'Delete saved Kibana object?'
}),
};
confirmModal(
`You can't recover deleted objects`,
i18n.translate('kbn.management.objects.confirmModalOptions.warningTextMessage', {
Nox911 marked this conversation as resolved.
Show resolved Hide resolved
defaultMessage: 'You can\'t recover deleted objects',
}),
confirmModalOptions
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,37 @@
exports[`ObjectsTable delete should show a confirm modal 1`] = `
<EuiConfirmModal
buttonColor="primary"
cancelButtonText="Cancel"
confirmButtonText="Delete"
cancelButtonText={
<FormattedMessage
defaultMessage="Cancel"
id="kbn.management.objects.deleteConfirmModal.cancelButtonLabel"
values={Object {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this empty object necessary?

Copy link
Contributor Author

@Nox911 Nox911 Oct 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmcconaghy It's a snapshot of test. It generates automatically when tests is started.

/>
}
confirmButtonText={
<FormattedMessage
defaultMessage="Delete"
id="kbn.management.objects.deleteConfirmModal.deleteButtonLabel"
values={Object {}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question re: empty object

Copy link
Contributor Author

@Nox911 Nox911 Oct 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmcconaghy It's a snapshot of test. It generates automatically when tests is started.

}
defaultFocusedButton="confirm"
onCancel={[Function]}
onConfirm={[Function]}
title="Delete saved objects"
title={
<FormattedMessage
defaultMessage="Delete saved objects"
id="kbn.management.objects.deleteConfirmModalTitle"
values={Object {}}
/>
}
>
<p>
This action will delete the following saved objects:
<FormattedMessage
defaultMessage="This action will delete the following saved objects:"
id="kbn.management.objects.deleteConfirmModalDescription"
values={Object {}}
/>
</p>
<EuiInMemoryTable
columns={
Expand Down Expand Up @@ -50,15 +72,43 @@ exports[`ObjectsTable delete should show a confirm modal 1`] = `
exports[`ObjectsTable export should allow the user to choose when exporting all 1`] = `
<EuiConfirmModal
buttonColor="primary"
cancelButtonText="Cancel"
confirmButtonText="Export All"
cancelButtonText={
<FormattedMessage
defaultMessage="Cancel"
id="kbn.management.objects.exportConfirmModal.cancelButtonLabel"
values={Object {}}
/>
}
confirmButtonText={
<FormattedMessage
defaultMessage="Export All"
id="kbn.management.objects.exportConfirmModal.exportButtonLabel"
values={Object {}}
/>
}
defaultFocusedButton="confirm"
onCancel={[Function]}
onConfirm={[Function]}
title="Export 4 objects"
title={
<FormattedMessage
defaultMessage="Export {filteredItemCount} {filteredItemCountDescription}"
id="kbn.management.objects.exportConfirmModalTitle"
values={
Object {
"filteredItemCount": 4,
"filteredItemCountDescription": "objects",
}
}
/>
}
>
<p>
Select which types to export. The number in parentheses indicates how many of this type are available to export.
<FormattedMessage
defaultMessage="Select which types to export. The number in parentheses indicates
how many of this type are available to export."
id="kbn.management.objects.exportConfirmModalDescription"
values={Object {}}
/>
</p>
<EuiCheckboxGroup
idToSelectedMap={
Expand Down Expand Up @@ -95,7 +145,7 @@ exports[`ObjectsTable export should allow the user to choose when exporting all
`;

exports[`ObjectsTable import should show the flyout 1`] = `
<Flyout
<InjectIntl(FlyoutUI)
close={[Function]}
done={[Function]}
indexPatterns={
Expand All @@ -111,7 +161,7 @@ exports[`ObjectsTable import should show the flyout 1`] = `
`;

exports[`ObjectsTable relationships should show the flyout 1`] = `
<Relationships
<InjectIntl(RelationshipsUI)
close={[Function]}
getEditUrl={[Function]}
getRelationships={[Function]}
Expand Down Expand Up @@ -150,7 +200,7 @@ exports[`ObjectsTable should render normally 1`] = `
<EuiSpacer
size="xs"
/>
<Table
<InjectIntl(TableUI)
filterOptions={
Array [
Object {
Expand Down
Loading