From 1ee46ab98aefdb30787b5ef2fbf5930f3f43b6c3 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Wed, 11 Mar 2020 13:01:44 -0400 Subject: [PATCH 1/2] Mark access removal prompts for translation --- .../client/lib/services/base-string.service.js | 12 ++++++++++++ .../rbac-role-column/roleList.directive.js | 16 ++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/lib/services/base-string.service.js b/awx/ui/client/lib/services/base-string.service.js index 3e7b3b7cd7..ccd5dc2c64 100644 --- a/awx/ui/client/lib/services/base-string.service.js +++ b/awx/ui/client/lib/services/base-string.service.js @@ -85,6 +85,18 @@ function BaseStringService (namespace) { CONFIRM: resourceType => t.s('Are you sure you want to delete this {{ resourceType }}?', { resourceType }) }; + this.removeTeamAccess = { + HEADER: t.s('Team access removal'), + ACTION_TEXT: t.s('REMOVE TEAM ACCESS'), + CONFIRM: (role, name) => t.s('Please confirm that you would like to remove {{ role }} access from the team {{ name }}. This will affect all members of the team. If you would like to only remove access for this particular user, please remove them from the team.', { role, name }), + }; + + this.removeUserAccess = { + HEADER: t.s('Role access removal'), + ACTION_TEXT: t.s('REMOVE ACCESS'), + CONFIRM: (role, name) => t.s('Please confirm that you would like to remove {{ role }} access from {{ name }}.', { role, name }), + }; + this.cancelJob = { HEADER: t.s('Cancel'), SUBMIT_REQUEST: t.s('Are you sure you want to submit the request to cancel this job?'), diff --git a/awx/ui/client/src/access/rbac-role-column/roleList.directive.js b/awx/ui/client/src/access/rbac-role-column/roleList.directive.js index 55bf04dc51..3dd3ee0790 100644 --- a/awx/ui/client/src/access/rbac-role-column/roleList.directive.js +++ b/awx/ui/client/src/access/rbac-role-column/roleList.directive.js @@ -1,7 +1,7 @@ /* jshint unused: vars */ export default - [ 'templateUrl', 'Wait', 'GetBasePath', 'Rest', '$state', 'ProcessErrors', 'Prompt', '$filter', '$rootScope', 'i18n', - function(templateUrl, Wait, GetBasePath, Rest, $state, ProcessErrors, Prompt, $filter, $rootScope, i18n) { + [ 'templateUrl', 'Wait', 'GetBasePath', 'Rest', '$state', 'ProcessErrors', 'Prompt', '$filter', '$rootScope', 'i18n', 'AppStrings', + function(templateUrl, Wait, GetBasePath, Rest, $state, ProcessErrors, Prompt, $filter, $rootScope, i18n, strings) { return { restrict: 'E', scope: { @@ -96,17 +96,17 @@ export default if (accessListEntry.team_id) { Prompt({ - hdr: i18n._(`Team access removal`), - body: `
Please confirm that you would like to remove ${entry.name} access from the team ${$filter('sanitize')(entry.team_name)}. This will affect all members of the team. If you would like to only remove access for this particular user, please remove them from the team.
`, + hdr: strings.get('removeTeamAccess.HEADER'), + body: `
${strings.get('removeTeamAccess.CONFIRM', entry.name, $filter('sanitize')(entry.team_name))}
`, action: action, - actionText: i18n._('REMOVE TEAM ACCESS') + actionText: strings.get('removeTeamAccess.ACTION_TEXT'), }); } else { Prompt({ - hdr: i18n._(`User access removal`), - body: `
Please confirm that you would like to remove ${entry.name} access from ${$filter('sanitize')(user.username)}.
`, + hdr: strings.get('removeUserAccess.HEADER'), + body: `
${strings.get('removeUserAccess.CONFIRM', entry.name, $filter('sanitize')(user.username))}
`, action: action, - actionText: i18n._('REMOVE') + actionText: strings.get('removeUserAccess.ACTION_TEXT'), }); } }; From 8e7faa853ed580b3acae23e38717b8c54ba44809 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Wed, 11 Mar 2020 13:47:10 -0400 Subject: [PATCH 2/2] Mark tech preview message for translation --- .../container-groups/add-container-group.view.html | 2 +- awx/ui/client/src/instance-groups/instance-groups.strings.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/instance-groups/container-groups/add-container-group.view.html b/awx/ui/client/src/instance-groups/container-groups/add-container-group.view.html index 3e27ee18bf..04627d8853 100644 --- a/awx/ui/client/src/instance-groups/container-groups/add-container-group.view.html +++ b/awx/ui/client/src/instance-groups/container-groups/add-container-group.view.html @@ -2,7 +2,7 @@
- This feature is currently in tech preview and is subject to change in a future release. Click here for documentation. + {{:: vm.strings.get('state.TECH_PREVIEW_MESSAGE_BAR') }}
diff --git a/awx/ui/client/src/instance-groups/instance-groups.strings.js b/awx/ui/client/src/instance-groups/instance-groups.strings.js index 74fd210350..5a01f28682 100644 --- a/awx/ui/client/src/instance-groups/instance-groups.strings.js +++ b/awx/ui/client/src/instance-groups/instance-groups.strings.js @@ -10,7 +10,8 @@ function InstanceGroupsStrings(BaseString) { INSTANCE_GROUPS_BREADCRUMB_LABEL: t.s('INSTANCE GROUPS'), INSTANCES_BREADCRUMB_LABEL: t.s('INSTANCES'), ADD_BREADCRUMB_LABEL: t.s('CREATE INSTANCE GROUP'), - ADD_CONTAINER_GROUP_BREADCRUMB_LABEL: t.s('CREATE CONTAINER GROUP') + ADD_CONTAINER_GROUP_BREADCRUMB_LABEL: t.s('CREATE CONTAINER GROUP'), + TECH_PREVIEW_MESSAGE_BAR: t.s('This feature is currently in tech preview and is subject to change in a future release. Click here for documentation.'), }; ns.list = {