From 832011aa99f3b93ab3793001291e01cc97451fb4 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 6 Dec 2016 11:40:21 -0500 Subject: [PATCH] Mark additional strings for translation. --- awx/ui/client/src/controllers/Projects.js | 16 ++++----- awx/ui/client/src/controllers/Users.js | 28 +++++++-------- .../dashboard/hosts/dashboard-hosts.list.js | 12 +++---- awx/ui/client/src/forms/JobTemplates.js | 12 +++---- awx/ui/client/src/forms/Projects.js | 6 ++-- awx/ui/client/src/forms/Teams.js | 2 +- awx/ui/client/src/forms/Users.js | 10 +++--- awx/ui/client/src/forms/Workflows.js | 4 +-- awx/ui/client/src/helpers/Credentials.js | 10 +++--- .../client/src/license/license.controller.js | 4 +-- awx/ui/client/src/lists/CompletedJobs.js | 4 +-- awx/ui/client/src/lists/Inventories.js | 3 +- awx/ui/client/src/lists/Teams.js | 3 +- awx/ui/client/src/lists/Templates.js | 7 ++-- awx/ui/client/src/lists/Users.js | 2 +- .../thirdPartySignOn.service.js | 4 +-- .../src/notifications/notifications.list.js | 4 +-- awx/ui/client/src/shared/form-generator.js | 34 +++++++++++-------- 18 files changed, 82 insertions(+), 83 deletions(-) diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index 429338cd5f..17076a2a73 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -281,7 +281,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, .success(function(data) { if (!data.actions.POST) { $state.go("^"); - Alert('Permission Error', 'You do not have permission to add a project.', 'alert-info'); + Alert(i18n._('Permission Error'), i18n._('You do not have permission to add a project.'), 'alert-info'); } }); @@ -465,7 +465,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, }); $scope.project_local_paths = opts; $scope.local_path = $scope.project_local_paths[0]; - $scope.base_dir = 'You do not have access to view this property'; + $scope.base_dir = i18n._('You do not have access to view this property'); $scope.$emit('pathsReady'); } @@ -555,7 +555,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, }) .error(function (data, status) { ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), - msg: i18n._('Failed to retrieve project: ') + id + i18n._('. GET status: ') + status + msg: i18n.sprintf(i18n._('Failed to retrieve project: %s. GET status: '), id) + status }); }); }); @@ -620,7 +620,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $state.go($state.current, {}, { reload: true }); }) .error(function(data, status) { - ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status }); + ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Failed to update project: %s. PUT status: '), id) + status }); }); }; @@ -638,7 +638,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, }) .error(function(data, status) { $('#prompt-modal').modal('hide'); - ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST returned status: ' + status }); + ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. POST returned status: '), url) + status }); }); }; @@ -646,7 +646,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, hdr: i18n._('Delete'), body: '
' + i18n.sprintf(i18n._('Are you sure you want to remove the %s below from %s?'), title, $scope.name) + '
' + '
' + name + '
', action: action, - actionText: 'DELETE' + actionText: i18n._('DELETE') }); }; @@ -654,7 +654,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, if ($scope.scm_type) { $scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false; $scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false; - $scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch'; + $scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? i18n._('Revision #') : i18n._('SCM Branch'); } // Dynamically update popover values @@ -690,7 +690,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, if ($scope.project_obj.scm_type === "Manual" || Empty($scope.project_obj.scm_type)) { // ignore } else if ($scope.project_obj.status === 'updating' || $scope.project_obj.status === 'running' || $scope.project_obj.status === 'pending') { - Alert('Update in Progress', i18n._('The SCM update process is running.'), 'alert-info'); + Alert(i18n._('Update in Progress'), i18n._('The SCM update process is running.'), 'alert-info'); } else { ProjectUpdate({ scope: $scope, project_id: $scope.project_obj.id }); } diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 61ffb69d2e..e53f214e0f 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -91,17 +91,17 @@ export function UsersList($scope, $rootScope, $stateParams, }) .error(function(data, status) { ProcessErrors($scope, data, status, null, { - hdr: 'Error!', - msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status + hdr: i18n._('Error!'), + msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status }); }); }; Prompt({ - hdr: 'Delete', - body: '
Are you sure you want to delete the user below?
' + $filter('sanitize')(name) + '
', + hdr: i18n._('Delete'), + body: '
' + i18n._('Are you sure you want to delete the user below?') + '
' + $filter('sanitize')(name) + '
', action: action, - actionText: 'DELETE' + actionText: i18n._('DELETE') }); }; } @@ -138,7 +138,7 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm, .success(function(data) { if (!data.actions.POST) { $state.go("^"); - Alert('Permission Error', 'You do not have permission to add a user.', 'alert-info'); + Alert(i18n._('Permission Error'), i18n._('You do not have permission to add a user.'), 'alert-info'); } }); @@ -171,7 +171,7 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm, .success(function(data) { var base = $location.path().replace(/^\//, '').split('/')[0]; if (base === 'users') { - $rootScope.flashMessage = 'New user successfully created!'; + $rootScope.flashMessage = i18n._('New user successfully created!'); $rootScope.$broadcast("EditIndicatorChange", "users", data.id); $state.go('users.edit', { user_id: data.id }, { reload: true }); } else { @@ -179,10 +179,10 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm, } }) .error(function(data, status) { - ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to add new user. POST returned status: ' + status }); + ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n._('Failed to add new user. POST returned status: ') + status }); }); } else { - $scope.organization_name_api_error = 'A value is required'; + $scope.organization_name_api_error = i18n._('A value is required'); } } }; @@ -264,9 +264,8 @@ export function UsersEdit($scope, $rootScope, $location, }) .error(function(data, status) { ProcessErrors($scope, data, status, null, { - hdr: 'Error!', - msg: 'Failed to retrieve user: ' + - $stateParams.id + '. GET status: ' + status + hdr: i18n._('Error!'), + msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status }); }); } @@ -319,9 +318,8 @@ export function UsersEdit($scope, $rootScope, $location, }) .error(function(data, status) { ProcessErrors($scope, data, status, null, { - hdr: 'Error!', - msg: 'Failed to retrieve user: ' + - $stateParams.id + '. GET status: ' + status + hdr: i18n._('Error!'), + msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status }); }); } diff --git a/awx/ui/client/src/dashboard/hosts/dashboard-hosts.list.js b/awx/ui/client/src/dashboard/hosts/dashboard-hosts.list.js index 0c3c0adb9d..f439c0c859 100644 --- a/awx/ui/client/src/dashboard/hosts/dashboard-hosts.list.js +++ b/awx/ui/client/src/dashboard/hosts/dashboard-hosts.list.js @@ -38,7 +38,7 @@ export default [ 'i18n', function(i18n){ ngClick: 'editHost(host.id)' }, inventory_name: { - label: 'Inventory', + label: i18n._('Inventory'), sourceModel: 'inventory', sourceField: 'name', columnClass: 'col-lg-5 col-md-4 col-sm-4 hidden-xs elllipsis', @@ -46,13 +46,13 @@ export default [ 'i18n', function(i18n){ searchable: false }, enabled: { - label: 'Status', + label: i18n._('Status'), columnClass: 'List-staticColumn--toggle', type: 'toggle', ngClick: 'toggleHostEnabled(host)', nosort: true, - awToolTip: "

Indicates if a host is available and should be included in running jobs.

For hosts that are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.

", - dataTitle: 'Host Enabled', + awToolTip: "

" + i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.") + "

", + dataTitle: i18n._('Host Enabled'), } }, @@ -60,10 +60,10 @@ export default [ 'i18n', function(i18n){ columnClass: 'col-lg-2 col-md-3 col-sm-3 col-xs-4', edit: { - label: 'Edit', + label: i18n._('Edit'), ngClick: 'editHost(host.id)', icon: 'icon-edit', - awToolTip: 'Edit host', + awToolTip: i18n._('Edit host'), dataPlacement: 'top' } }, diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index 9fe64f0469..23be861723 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -20,7 +20,7 @@ export default addTitle: i18n._('New Job Template'), editTitle: '{{ name }}', name: 'job_template', - breadcrumbName: 'JOB TEMPLATE', + breadcrumbName: i18n._('JOB TEMPLATE'), basePath: 'job_templates', // the top-most node of generated state tree stateTree: 'templates', @@ -80,7 +80,7 @@ export default reqExpression: '!ask_inventory_on_launch', alwaysShowAsterisk: true }, - requiredErrorMsg: "Please select an Inventory or check the Prompt on launch option.", + requiredErrorMsg: i18n._("Please select an Inventory or check the Prompt on launch option."), column: 1, awPopOver: "

" + i18n._("Select the inventory containing the hosts you want this job to manage.") + "

", dataTitle: i18n._('Inventory'), @@ -96,7 +96,7 @@ export default project: { label: i18n._('Project'), labelAction: { - label: 'RESET', + label: i18n._('RESET'), ngClick: 'resetProjectToDefault()', 'class': "{{!(job_type.value === 'scan' && project_name !== 'Default') ? 'hidden' : ''}}", }, @@ -147,7 +147,7 @@ export default reqExpression: '!ask_credential_on_launch', alwaysShowAsterisk: true }, - requiredErrorMsg: "Please select a Machine Credential or check the Prompt on launch option.", + requiredErrorMsg: i18n._("Please select a Machine Credential or check the Prompt on launch option."), column: 1, awPopOver: "

" + i18n._("Select the credential you want the job to use when accessing the remote hosts. Choose the credential containing " + " the username and SSH key or password that Ansible will need to log into the remote hosts.") + "

", @@ -409,9 +409,9 @@ export default add: { ngClick: "$state.go('.add')", label: 'Add', - awToolTip: 'Add a permission', + awToolTip: i18n._('Add a permission'), actionClass: 'btn List-buttonSubmit', - buttonContent: '+ ADD', + buttonContent: '+ ' + i18n._('ADD'), ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' } }, diff --git a/awx/ui/client/src/forms/Projects.js b/awx/ui/client/src/forms/Projects.js index a1d65a82d5..7fef97a9ad 100644 --- a/awx/ui/client/src/forms/Projects.js +++ b/awx/ui/client/src/forms/Projects.js @@ -242,18 +242,18 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) fields: { username: { - label: 'User', + label: i18n._('User'), uiSref: 'users({user_id: field.id})', class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4' }, role: { - label: 'Role', + label: i18n._('Role'), type: 'role', noSort: true, class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4', }, team_roles: { - label: 'Team Roles', + label: i18n._('Team Roles'), type: 'team_roles', noSort: true, class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4', diff --git a/awx/ui/client/src/forms/Teams.js b/awx/ui/client/src/forms/Teams.js index a7f03a490b..c2550f5543 100644 --- a/awx/ui/client/src/forms/Teams.js +++ b/awx/ui/client/src/forms/Teams.js @@ -80,7 +80,7 @@ export default add: { // @issue https://github.com/ansible/ansible-tower/issues/3487 //ngClick: "addPermissionWithoutTeamTab", - label: 'Add', + label: i18n._('Add'), awToolTip: i18n._('Add user to team'), actionClass: 'btn List-buttonSubmit', buttonContent: '+ ' + i18n._('ADD'), diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 5e95b6166f..20f8126a83 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -136,10 +136,10 @@ export default fields: { name: { key: true, - label: 'Name' + label: i18n._('Name') }, description: { - label: 'Description' + label: i18n._('Description') } }, //hideOnSuperuser: true // RBAC defunct @@ -157,14 +157,14 @@ export default open: false, index: false, actions: {}, - emptyListText: 'This user is not a member of any teams', + emptyListText: i18n._('This user is not a member of any teams'), fields: { name: { key: true, - label: 'Name' + label: i18n._('Name') }, description: { - label: 'Description' + label: i18n._('Description') } }, //hideOnSuperuser: true // RBAC defunct diff --git a/awx/ui/client/src/forms/Workflows.js b/awx/ui/client/src/forms/Workflows.js index d281ae0e0b..136d0692a9 100644 --- a/awx/ui/client/src/forms/Workflows.js +++ b/awx/ui/client/src/forms/Workflows.js @@ -120,10 +120,10 @@ export default actions: { add: { ngClick: "$state.go('.add')", - label: 'Add', + label: i18n._('Add'), awToolTip: 'Add a permission', actionClass: 'btn List-buttonSubmit', - buttonContent: '+ ADD', + buttonContent: '+ '+ i18n._('ADD'), ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' } }, diff --git a/awx/ui/client/src/helpers/Credentials.js b/awx/ui/client/src/helpers/Credentials.js index 375a556be0..fb7477d61f 100644 --- a/awx/ui/client/src/helpers/Credentials.js +++ b/awx/ui/client/src/helpers/Credentials.js @@ -305,12 +305,12 @@ angular.module('CredentialsHelper', ['Utilities']) // the error there. The ssh_key_unlock field is not shown when the kind of credential is gce/azure and as a result the // error is never shown. In the future, the API will hopefully either behave or respond differently. if(status && status === 400 && data && data.ssh_key_unlock && (scope.kind.value === 'gce' || scope.kind.value === 'azure')) { - scope.ssh_key_data_api_error = "Encrypted credentials are not supported."; + scope.ssh_key_data_api_error = i18n._("Encrypted credentials are not supported."); } else { ProcessErrors(scope, data, status, form, { - hdr: 'Error!', - msg: 'Failed to create new Credential. POST status: ' + status + hdr: i18n._('Error!'), + msg: i18n._('Failed to create new Credential. POST status: ') + status }); } }); @@ -325,8 +325,8 @@ angular.module('CredentialsHelper', ['Utilities']) .error(function (data, status) { Wait('stop'); ProcessErrors(scope, data, status, form, { - hdr: 'Error!', - msg: 'Failed to update Credential. PUT status: ' + status + hdr: i18n._('Error!'), + msg: i18n._('Failed to update Credential. PUT status: ') + status }); }); } diff --git a/awx/ui/client/src/license/license.controller.js b/awx/ui/client/src/license/license.controller.js index 682f1cfb01..195178dd28 100644 --- a/awx/ui/client/src/license/license.controller.js +++ b/awx/ui/client/src/license/license.controller.js @@ -66,14 +66,14 @@ export default $scope.newLicense.file = JSON.parse(raw.result); } catch(err) { - ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'}); + ProcessErrors($rootScope, null, null, null, {msg: i18n._('Invalid file format. Please upload valid JSON.')}); } }; try { raw.readAsText(event.target.files[0]); } catch(err) { - ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'}); + ProcessErrors($rootScope, null, null, null, {msg: i18n._('Invalid file format. Please upload valid JSON.')}); } }; // HTML5 spec doesn't provide a way to customize file input css diff --git a/awx/ui/client/src/lists/CompletedJobs.js b/awx/ui/client/src/lists/CompletedJobs.js index dc219d629b..1c0436240c 100644 --- a/awx/ui/client/src/lists/CompletedJobs.js +++ b/awx/ui/client/src/lists/CompletedJobs.js @@ -72,14 +72,14 @@ export default icon: 'icon-rocket', mode: 'all', ngClick: 'relaunchJob($event, completed_job.id)', - awToolTip: 'Relaunch using the same parameters', + awToolTip: i18n._('Relaunch using the same parameters'), dataPlacement: 'top', ngShow: "!completed_job.type == 'system_job' || completed_job.summary_fields.user_capabilities.start" }, "delete": { mode: 'all', ngClick: 'deleteJob(completed_job.id)', - awToolTip: 'Delete the job', + awToolTip: i18n._('Delete the job'), dataPlacement: 'top', ngShow: 'completed_job.summary_fields.user_capabilities.delete' } diff --git a/awx/ui/client/src/lists/Inventories.js b/awx/ui/client/src/lists/Inventories.js index d3d68223cf..4ae755cfb6 100644 --- a/awx/ui/client/src/lists/Inventories.js +++ b/awx/ui/client/src/lists/Inventories.js @@ -15,8 +15,7 @@ export default selectTitle: i18n._('Add Inventories'), editTitle: i18n._('Inventories'), listTitle: i18n._('Inventories'), - selectInstructions: "Click on a row to select it, and click Finished when done. Click the " + - "button to create a new inventory.", + selectInstructions: i18n.sprintf(i18n._("Click on a row to select it, and click Finished when done. Click the %s button to create a new inventory."), " "), index: false, hover: true, basePath: 'inventory', diff --git a/awx/ui/client/src/lists/Teams.js b/awx/ui/client/src/lists/Teams.js index b9bb151a1a..0048be52d0 100644 --- a/awx/ui/client/src/lists/Teams.js +++ b/awx/ui/client/src/lists/Teams.js @@ -15,8 +15,7 @@ export default selectTitle: i18n._('Add Team'), editTitle: i18n._('Teams'), listTitle: i18n._('Teams'), - selectInstructions: "Click on a row to select it, and click Finished when done. Click the " + - "button to create a new team.", + selectInstructions: i18n.sprintf(i18n._("Click on a row to select it, and click Finished when done. Click the %s button to create a new team."), " "), index: false, hover: true, diff --git a/awx/ui/client/src/lists/Templates.js b/awx/ui/client/src/lists/Templates.js index 10a195f795..7db934ffd3 100644 --- a/awx/ui/client/src/lists/Templates.js +++ b/awx/ui/client/src/lists/Templates.js @@ -16,8 +16,7 @@ export default selectTitle: i18n._('Template'), editTitle: i18n._('Templates'), listTitle: i18n._('Templates'), - selectInstructions: "Click on a row to select it, and click Finished when done. Use the " + - "button to create a new job template.", + selectInstructions: i18n.sprintf(i18n._("Click on a row to select it, and click Finished when done. Use the %s button to create a new job template."), " "), index: false, hover: true, @@ -62,12 +61,12 @@ export default buttonContent: i18n._('ADD'), options: [ { - optionContent: 'Job Template', + optionContent: i18n._('Job Template'), optionSref: 'templates.addJobTemplate', ngShow: 'canAddJobTemplate' }, { - optionContent: 'Workflow Job Template', + optionContent: i18n._('Workflow Job Template'), optionSref: 'templates.addWorkflowJobTemplate', ngShow: 'canAddWorkflowJobTemplate' } diff --git a/awx/ui/client/src/lists/Users.js b/awx/ui/client/src/lists/Users.js index 3efb0f7ce3..bfff119616 100644 --- a/awx/ui/client/src/lists/Users.js +++ b/awx/ui/client/src/lists/Users.js @@ -49,7 +49,7 @@ export default actions: { add: { - label: 'Create New', + label: i18n._('Create New'), mode: 'all', // One of: edit, select, all ngClick: 'addUser()', basePaths: ['organizations', 'users'], // base path must be in list, or action not available diff --git a/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.service.js b/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.service.js index 7ab1980495..ab35628d12 100644 --- a/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.service.js +++ b/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.service.js @@ -116,8 +116,8 @@ return {"options": options, "error": error}; }) .catch(function (data) { - ProcessErrors(scope, data.data, data.status, null, { hdr: 'Error!', - msg: 'Failed to get third-party login types. Returned status: ' + data.status }); + ProcessErrors(scope, data.data, data.status, null, { hdr: i18n._('Error!'), + msg: i18n._('Failed to get third-party login types. Returned status: ') + data.status }); }); }; }]; diff --git a/awx/ui/client/src/notifications/notifications.list.js b/awx/ui/client/src/notifications/notifications.list.js index 5509dfebfe..7a7a345c96 100644 --- a/awx/ui/client/src/notifications/notifications.list.js +++ b/awx/ui/client/src/notifications/notifications.list.js @@ -18,7 +18,7 @@ export default ['i18n', function(i18n){ iterator: 'notification', index: false, hover: false, - emptyListText: "This list is populated by notification templates added from the Notifications section", + emptyListText: i18n.sprintf(i18n._("This list is populated by notification templates added from the %sNotifications%s section"), " ", " "), basePath: 'notification_templates', fields: { name: { @@ -60,7 +60,7 @@ export default ['i18n', function(i18n){ }, actions: { add: { - label: 'Add Notification', + label: i18n._('Add Notification'), mode: 'all', // One of: edit, select, all ngClick: 'addNotificationTemplate()', awToolTip: i18n._('Create a new notification template'), diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 5866a464ba..3c931b64d2 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -542,9 +542,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += (field.flag) ? field.flag : "enabled"; html += "\}' aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'>
ON
" + i18n._("ON") + "
OFF
"; + html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>" + i18n._("OFF") + ""; } return html; }, @@ -1041,7 +1041,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // Add error messages if (field.required) { html += "
" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please enter a value.") + "
\n"; + this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please enter a value.")) + "\n"; } html += "
\n"; html += "\n"; @@ -1108,7 +1108,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // Add error messages if (field.required || field.awRequiredWhen) { html += "
" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select a value."); + this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select a value.")); if (field.includePlaybookNotFoundError) { html += " Playbook {{ job_template_obj.playbook }} not found for project.\n"; } @@ -1177,15 +1177,19 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // Add error messages if (field.required) { html += "
" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select a value.") + "
\n"; + this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select a value.")) + "
\n"; } if (field.integer) { - html += "
Please enter a number.
\n"; + html += "
" + i18n._("Please enter a number.") + "
\n"; } if (field.min !== undefined || field.max !== undefined) { html += "
Please enter a number greater than " + field.min; - html += (field.max !== undefined) ? " and less than " + field.max + "." : "."; + this.form.name + '_form.' + fld + ".$error.max\">"; + if (field.max !== undefined) { + html += i18n.sprintf(i18n._("Please enter a number greater than %d and less than %d."), field.min, field.max) + } else { + html += i18n.sprintf(i18n._("Please enter a number greater than %d.", field.min) + } html += "
\n"; } html += "
\n"; @@ -1210,14 +1214,14 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // Add error messages if (field.required) { html += "
" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select at least one value.") + "
\n"; + this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select at least one value.")) + "\n"; } if (field.integer) { - html += "
Please select a number.
\n"; + html += "
" + i18n._("Please select a number.") + "
\n"; } if (field.min || field.max) { html += "
Please select a number between " + field.min + " and " + + this.form.name + '_form.' + fld + ".$error.max\">" + i18n._("Please select a number between ") + field.min + i18n._(" and ") + field.max + "
\n"; } html += "
\n"; @@ -1291,7 +1295,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat if (field.required || field.awRequiredWhen) { html += "
Please select a value.
\n"; + this.form.name + '_form.' + fld + ".$error.required\">" + i18n._("Please select a value.)" + "\n"; } html += "
\n"; @@ -1396,13 +1400,13 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + ".$dirty && " + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + - ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select a value.") + "\n"; + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select a value.")) + "\n"; } html += "
That value was not found. Please enter or select a valid value.
\n"; + ".$error.awlookup\">" + i18n._("That value was not found. Please enter or select a valid value.") + "\n"; html += "
\n"; html += "\n"; @@ -1858,7 +1862,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat `; // Show the "no items" box when loading is done and the user isn't actively searching and there are no results - var emptyListText = (collection.emptyListText) ? collection.emptyListText : "PLEASE ADD ITEMS TO THIS LIST"; + var emptyListText = (collection.emptyListText) ? collection.emptyListText : i18n._("PLEASE ADD ITEMS TO THIS LIST"); html += `
`; html += `
${emptyListText}
`; html += '
';