Translate security/roles component#23984
Conversation
💔 Build Failed |
💔 Build Failed |
|
retest |
💔 Build Failed |
| <EuiLink onClick={this.toggleCollapsed}>{this.state.collapsed ? 'show' : 'hide'}</EuiLink> | ||
| <EuiLink onClick={this.toggleCollapsed}> | ||
| {this.state.collapsed | ||
| ? intl.formatMessage({ |
There was a problem hiding this comment.
You can use FormattedMessage here. So you do not need to use injectI18n
| {this.state.collapsed | ||
| ? intl.formatMessage({ | ||
| id: | ||
| 'xpack.security.views.management.editRoles.components.collapsiblePanel.showTitle', |
There was a problem hiding this comment.
showTitle => showLinkText
| }) | ||
| : intl.formatMessage({ | ||
| id: | ||
| 'xpack.security.views.management.editRoles.components.collapsiblePanel.hideTitle', |
There was a problem hiding this comment.
hideTitle => hideLinkText
| <EuiOverlayMask> | ||
| <EuiConfirmModal | ||
| title={'Delete Role'} | ||
| title={intl.formatMessage({ |
There was a problem hiding this comment.
Check if title property supports JSX. I mean try to use FormattedMessage. If it works, then do not use injectI18n
| <EuiButtonEmpty color={'danger'} onClick={this.showModal}> | ||
| Delete role | ||
| <FormattedMessage | ||
| id="xpack.security.views.management.editRoles.components.deleteRoleButton.deleteRoleButton" |
There was a problem hiding this comment.
=> deleteRoleButtonLabel
| i18n('xpack.security.views.management.roles.deleteRoleTitle', { | ||
| values: { | ||
| valueText: $scope.selectedRoles.length > 1 ? | ||
| i18n('xpack.security.views.management.roles.deleteRoleRolesTitle', { defaultMessage: 'roles' }) |
There was a problem hiding this comment.
deleteRoleRolesTitle => rolesSuccessfullyDeletedNotificationMessage
| .then(() => toastNotifications.addSuccess( | ||
| i18n('xpack.security.views.management.roles.deleteRoleTitle', { | ||
| values: { | ||
| valueText: $scope.selectedRoles.length > 1 ? |
There was a problem hiding this comment.
use plural from ICU format for such cases. Come to me and I'll show you how to do it
| }; | ||
| const confirmModalOptions = { | ||
| confirmButtonText: 'Delete role(s)', | ||
| confirmButtonText: i18n('xpack.security.views.management.roles.deleteRoleButton', { defaultMessage: 'Delete role(s)' }), |
There was a problem hiding this comment.
deleteRoleButton => deleteRoleConfirmButtonLabel
| confirmModalOptions | ||
| confirmModal( | ||
| i18n('xpack.security.views.management.roles.sureToDeleteRoleTitle', { | ||
| defaultMessage: 'Are you sure you want to delete the selected role(s)? This action is irreversible!' |
There was a problem hiding this comment.
sureToDeleteRoleTitle => deletingRolesWarningMessage
| return $scope.roles.filter((role) => !role.metadata._reserved); | ||
| } | ||
|
|
||
| $scope.noFoundMatches = i18n('xpack.security.views.management.roles.noMatches', { |
There was a problem hiding this comment.
noMatches => matchingText
💔 Build Failed |
| this.props.editable | ||
| ? intl.formatMessage({ | ||
| id: | ||
| 'xpack.security.views.management.editRoles.components.privileges.es.elasticSearchPrivileges.addUserTitle', |
There was a problem hiding this comment.
addUserTitle => addUserPlaceholder
| This role always grants read access to all spaces. To customize privileges for | ||
| individual spaces, you must create a new role. | ||
| <FormattedMessage | ||
| id="xpack.security.views.management.editRoles.components.privileges.kibana.privilegeCalloutWarning.alwaysGrantReadRoleTitle" |
| This role never grants access to any spaces within Kibana. To customize privileges for | ||
| individual spaces, you must create a new role. | ||
| <FormattedMessage | ||
| id="xpack.security.views.management.editRoles.components.privileges.kibana.privilegeCalloutWarning.roleNeverAccessTitle" |
| class="kuiTableHeaderCell__liner" | ||
| i18n-id="xpack.security.views.management.roles.roleTitle" | ||
| i18n-default-message="Role {icon}" | ||
| i18n-values="{ |
There was a problem hiding this comment.
after #23684 is merged we will need to name properties which contain angular directives with unsafe_ prefix. So please check all places in this MR where you use i18n-values and if property contains directives - use prefix unsafe_.
for example icon => unsafe_icon
| .then(() => | ||
| toastNotifications.addSuccess( | ||
| i18n('xpack.security.views.management.roles.deleteRoleTitle', { | ||
| defaultMessage: 'Deleted {value, plural, one {# role} other {# roles}}', |
There was a problem hiding this comment.
remove #, just {role} other {roles}
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
| helptext = 'View, edit, and share objects and apps within all spaces'; | ||
| helptext = intl.formatMessage({ | ||
| id: | ||
| 'xpack.security.views.management.editRoles.components.privileges.kibana.spaceAwarePrivilegeForm.viewEditShareAppsWithinAllSpacesHelpText', |
There was a problem hiding this comment.
@azasypkin it'd be neat if the first part of these keys could be inferred by the component tree context so you could do something like:
intl.formatMessage({
id: `spaceAwarePrivilegeForm.viewEditShareAppsWithinAllSpacesHelpText`
defaultMessage: '...'
});There was a problem hiding this comment.
xpack.security.views.management.editRoles.components.privileges.kibana.spaceAwarePrivilegeForm.viewEditShareAppsWithinAllSpacesHelpText
Ugh, I believe it's a bad id: it's too detailed and contains a bunch of useless info (views?, editRoles implies both views and management, components is useless and doesn't say anything, privilges.kibana - seems to be useless since we have spaceAwarePrivilegeForm), we should have more laconic and useful ids. Why not just something like this?
Rule: {plugin}.{area}.[{sub-area}].{element}
Example: {xpack.security}.{editRoles}.{spaceAwarePrivilegeForm}.{viewEditShareAppsWithinAllSpacesHelpText}
I doubt that we'll have collision with this shorter form. @pavel06081991 @maryia-lapata thoughts?
There was a problem hiding this comment.
yeah, agree. we will use it for all new ids
joshdover
left a comment
There was a problem hiding this comment.
LGTM after removing these lines
| return valid(); | ||
| } | ||
| return invalid('Privilege is required'); | ||
| // return invalid('Privilege is required'); |
| if (!this.props.readonly) { | ||
| columns.push({ | ||
| name: 'Actions', | ||
| // name: 'Actions', |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
|
retest |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
|
retest |
💔 Build Failed |
|
retest |
💚 Build Succeeded |
Translate security/roles component
Translation of Security Roles visualization components