1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #4298 from wenottingham/stringy

Mark more strings for translation.
This commit is contained in:
Bill Nottingham 2016-12-12 11:55:23 -05:00 committed by GitHub
commit abbe41dbac
19 changed files with 530 additions and 292 deletions

View File

@ -281,7 +281,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log,
.success(function(data) { .success(function(data) {
if (!data.actions.POST) { if (!data.actions.POST) {
$state.go("^"); $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.project_local_paths = opts;
$scope.local_path = $scope.project_local_paths[0]; $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'); $scope.$emit('pathsReady');
} }
@ -555,7 +555,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), 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 }); $state.go($state.current, {}, { reload: true });
}) })
.error(function(data, status) { .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) { .error(function(data, status) {
$('#prompt-modal').modal('hide'); $('#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'), hdr: i18n._('Delete'),
body: '<div class="Prompt-bodyQuery">' + i18n.sprintf(i18n._('Are you sure you want to remove the %s below from %s?'), title, $scope.name) + '</div>' + '<div class="Prompt-bodyTarget">' + name + '</div>', body: '<div class="Prompt-bodyQuery">' + i18n.sprintf(i18n._('Are you sure you want to remove the %s below from %s?'), title, $scope.name) + '</div>' + '<div class="Prompt-bodyTarget">' + name + '</div>',
action: action, action: action,
actionText: 'DELETE' actionText: i18n._('DELETE')
}); });
}; };
@ -654,7 +654,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
if ($scope.scm_type) { if ($scope.scm_type) {
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false; $scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($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 // 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)) { if ($scope.project_obj.scm_type === "Manual" || Empty($scope.project_obj.scm_type)) {
// ignore // ignore
} else if ($scope.project_obj.status === 'updating' || $scope.project_obj.status === 'running' || $scope.project_obj.status === 'pending') { } 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 { } else {
ProjectUpdate({ scope: $scope, project_id: $scope.project_obj.id }); ProjectUpdate({ scope: $scope, project_id: $scope.project_obj.id });
} }

View File

@ -91,17 +91,17 @@ export function UsersList($scope, $rootScope, $stateParams,
}) })
.error(function(data, status) { .error(function(data, status) {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: i18n._('Error!'),
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status
}); });
}); });
}; };
Prompt({ Prompt({
hdr: 'Delete', hdr: i18n._('Delete'),
body: '<div class="Prompt-bodyQuery">Are you sure you want to delete the user below?</div><div class="Prompt-bodyTarget">' + $filter('sanitize')(name) + '</div>', body: '<div class="Prompt-bodyQuery">' + i18n._('Are you sure you want to delete the user below?') + '</div><div class="Prompt-bodyTarget">' + $filter('sanitize')(name) + '</div>',
action: action, action: action,
actionText: 'DELETE' actionText: i18n._('DELETE')
}); });
}; };
} }
@ -114,7 +114,7 @@ UsersList.$inject = ['$scope', '$rootScope', '$stateParams',
export function UsersAdd($scope, $rootScope, $stateParams, UserForm, export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope, GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope,
GetBasePath, ResetForm, Wait, CreateSelect2, $state, $location) { GetBasePath, ResetForm, Wait, CreateSelect2, $state, $location, i18n) {
ClearScope(); ClearScope();
@ -138,7 +138,7 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
.success(function(data) { .success(function(data) {
if (!data.actions.POST) { if (!data.actions.POST) {
$state.go("^"); $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) { .success(function(data) {
var base = $location.path().replace(/^\//, '').split('/')[0]; var base = $location.path().replace(/^\//, '').split('/')[0];
if (base === 'users') { if (base === 'users') {
$rootScope.flashMessage = 'New user successfully created!'; $rootScope.flashMessage = i18n._('New user successfully created!');
$rootScope.$broadcast("EditIndicatorChange", "users", data.id); $rootScope.$broadcast("EditIndicatorChange", "users", data.id);
$state.go('users.edit', { user_id: data.id }, { reload: true }); $state.go('users.edit', { user_id: data.id }, { reload: true });
} else { } else {
@ -179,10 +179,10 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
} }
}) })
.error(function(data, status) { .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 { } else {
$scope.organization_name_api_error = 'A value is required'; $scope.organization_name_api_error = i18n._('A value is required');
} }
} }
}; };
@ -201,7 +201,7 @@ export function UsersAdd($scope, $rootScope, $stateParams, UserForm,
UsersAdd.$inject = ['$scope', '$rootScope', '$stateParams', 'UserForm', 'GenerateForm', UsersAdd.$inject = ['$scope', '$rootScope', '$stateParams', 'UserForm', 'GenerateForm',
'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath',
'ResetForm', 'Wait', 'CreateSelect2', '$state', '$location' 'ResetForm', 'Wait', 'CreateSelect2', '$state', '$location', 'i18n'
]; ];
export function UsersEdit($scope, $rootScope, $location, export function UsersEdit($scope, $rootScope, $location,
@ -264,9 +264,8 @@ export function UsersEdit($scope, $rootScope, $location,
}) })
.error(function(data, status) { .error(function(data, status) {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: i18n._('Error!'),
msg: 'Failed to retrieve user: ' + msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status
$stateParams.id + '. GET status: ' + status
}); });
}); });
} }
@ -319,9 +318,8 @@ export function UsersEdit($scope, $rootScope, $location,
}) })
.error(function(data, status) { .error(function(data, status) {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: i18n._('Error!'),
msg: 'Failed to retrieve user: ' + msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status
$stateParams.id + '. GET status: ' + status
}); });
}); });
} }

View File

@ -38,7 +38,7 @@ export default [ 'i18n', function(i18n){
ngClick: 'editHost(host.id)' ngClick: 'editHost(host.id)'
}, },
inventory_name: { inventory_name: {
label: 'Inventory', label: i18n._('Inventory'),
sourceModel: 'inventory', sourceModel: 'inventory',
sourceField: 'name', sourceField: 'name',
columnClass: 'col-lg-5 col-md-4 col-sm-4 hidden-xs elllipsis', columnClass: 'col-lg-5 col-md-4 col-sm-4 hidden-xs elllipsis',
@ -46,13 +46,13 @@ export default [ 'i18n', function(i18n){
searchable: false searchable: false
}, },
enabled: { enabled: {
label: 'Status', label: i18n._('Status'),
columnClass: 'List-staticColumn--toggle', columnClass: 'List-staticColumn--toggle',
type: 'toggle', type: 'toggle',
ngClick: 'toggleHostEnabled(host)', ngClick: 'toggleHostEnabled(host)',
nosort: true, nosort: true,
awToolTip: "<p>Indicates if a host is available and should be included in running jobs.</p><p>For hosts that are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.</p>", awToolTip: "<p>" + i18n._("Indicates if a host is available and should be included in running jobs.") + "</p><p>" + i18n._("For hosts that are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.") + "</p>",
dataTitle: 'Host Enabled', 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', columnClass: 'col-lg-2 col-md-3 col-sm-3 col-xs-4',
edit: { edit: {
label: 'Edit', label: i18n._('Edit'),
ngClick: 'editHost(host.id)', ngClick: 'editHost(host.id)',
icon: 'icon-edit', icon: 'icon-edit',
awToolTip: 'Edit host', awToolTip: i18n._('Edit host'),
dataPlacement: 'top' dataPlacement: 'top'
} }
}, },

View File

@ -20,7 +20,7 @@ export default
addTitle: i18n._('New Job Template'), addTitle: i18n._('New Job Template'),
editTitle: '{{ name }}', editTitle: '{{ name }}',
name: 'job_template', name: 'job_template',
breadcrumbName: 'JOB TEMPLATE', breadcrumbName: i18n._('JOB TEMPLATE'),
basePath: 'job_templates', basePath: 'job_templates',
// the top-most node of generated state tree // the top-most node of generated state tree
stateTree: 'templates', stateTree: 'templates',
@ -80,7 +80,7 @@ export default
reqExpression: '!ask_inventory_on_launch', reqExpression: '!ask_inventory_on_launch',
alwaysShowAsterisk: true 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, column: 1,
awPopOver: "<p>" + i18n._("Select the inventory containing the hosts you want this job to manage.") + "</p>", awPopOver: "<p>" + i18n._("Select the inventory containing the hosts you want this job to manage.") + "</p>",
dataTitle: i18n._('Inventory'), dataTitle: i18n._('Inventory'),
@ -96,7 +96,7 @@ export default
project: { project: {
label: i18n._('Project'), label: i18n._('Project'),
labelAction: { labelAction: {
label: 'RESET', label: i18n._('RESET'),
ngClick: 'resetProjectToDefault()', ngClick: 'resetProjectToDefault()',
'class': "{{!(job_type.value === 'scan' && project_name !== 'Default') ? 'hidden' : ''}}", 'class': "{{!(job_type.value === 'scan' && project_name !== 'Default') ? 'hidden' : ''}}",
}, },
@ -147,7 +147,7 @@ export default
reqExpression: '!ask_credential_on_launch', reqExpression: '!ask_credential_on_launch',
alwaysShowAsterisk: true 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, column: 1,
awPopOver: "<p>" + i18n._("Select the credential you want the job to use when accessing the remote hosts. Choose the credential containing " + awPopOver: "<p>" + 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.") + "</p>", " the username and SSH key or password that Ansible will need to log into the remote hosts.") + "</p>",
@ -409,9 +409,9 @@ export default
add: { add: {
ngClick: "$state.go('.add')", ngClick: "$state.go('.add')",
label: 'Add', label: 'Add',
awToolTip: 'Add a permission', awToolTip: i18n._('Add a permission'),
actionClass: 'btn List-buttonSubmit', actionClass: 'btn List-buttonSubmit',
buttonContent: '&#43; ADD', buttonContent: '&#43; ' + i18n._('ADD'),
ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)'
} }
}, },

View File

@ -241,18 +241,18 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
fields: { fields: {
username: { username: {
label: 'User', label: i18n._('User'),
uiSref: 'users({user_id: field.id})', uiSref: 'users({user_id: field.id})',
class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4' class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4'
}, },
role: { role: {
label: 'Role', label: i18n._('Role'),
type: 'role', type: 'role',
noSort: true, noSort: true,
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4', class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
}, },
team_roles: { team_roles: {
label: 'Team Roles', label: i18n._('Team Roles'),
type: 'team_roles', type: 'team_roles',
noSort: true, noSort: true,
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4', class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',

View File

@ -80,7 +80,7 @@ export default
add: { add: {
// @issue https://github.com/ansible/ansible-tower/issues/3487 // @issue https://github.com/ansible/ansible-tower/issues/3487
//ngClick: "addPermissionWithoutTeamTab", //ngClick: "addPermissionWithoutTeamTab",
label: 'Add', label: i18n._('Add'),
awToolTip: i18n._('Add user to team'), awToolTip: i18n._('Add user to team'),
actionClass: 'btn List-buttonSubmit', actionClass: 'btn List-buttonSubmit',
buttonContent: '&#43; ' + i18n._('ADD'), buttonContent: '&#43; ' + i18n._('ADD'),

View File

@ -136,10 +136,10 @@ export default
fields: { fields: {
name: { name: {
key: true, key: true,
label: 'Name' label: i18n._('Name')
}, },
description: { description: {
label: 'Description' label: i18n._('Description')
} }
}, },
//hideOnSuperuser: true // RBAC defunct //hideOnSuperuser: true // RBAC defunct
@ -157,14 +157,14 @@ export default
open: false, open: false,
index: false, index: false,
actions: {}, actions: {},
emptyListText: 'This user is not a member of any teams', emptyListText: i18n._('This user is not a member of any teams'),
fields: { fields: {
name: { name: {
key: true, key: true,
label: 'Name' label: i18n._('Name')
}, },
description: { description: {
label: 'Description' label: i18n._('Description')
} }
}, },
//hideOnSuperuser: true // RBAC defunct //hideOnSuperuser: true // RBAC defunct

View File

@ -120,10 +120,10 @@ export default
actions: { actions: {
add: { add: {
ngClick: "$state.go('.add')", ngClick: "$state.go('.add')",
label: 'Add', label: i18n._('Add'),
awToolTip: 'Add a permission', awToolTip: 'Add a permission',
actionClass: 'btn List-buttonSubmit', actionClass: 'btn List-buttonSubmit',
buttonContent: '&#43; ADD', buttonContent: '&#43; '+ i18n._('ADD'),
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
} }
}, },

View File

@ -223,8 +223,8 @@ angular.module('CredentialsHelper', ['Utilities'])
} }
]) ])
.factory('FormSave', ['$rootScope', '$location', 'Alert', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller', 'Wait', '$state', .factory('FormSave', ['$rootScope', '$location', 'Alert', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller', 'Wait', '$state', 'i18n',
function ($rootScope, $location, Alert, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller, Wait, $state) { function ($rootScope, $location, Alert, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller, Wait, $state, i18n) {
return function (params) { return function (params) {
var scope = params.scope, var scope = params.scope,
mode = params.mode, mode = params.mode,
@ -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 // 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. // 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')) { 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 { else {
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, {
hdr: 'Error!', hdr: i18n._('Error!'),
msg: 'Failed to create new Credential. POST status: ' + status msg: i18n._('Failed to create new Credential. POST status: ') + status
}); });
} }
}); });
@ -325,8 +325,8 @@ angular.module('CredentialsHelper', ['Utilities'])
.error(function (data, status) { .error(function (data, status) {
Wait('stop'); Wait('stop');
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, {
hdr: 'Error!', hdr: i18n._('Error!'),
msg: 'Failed to update Credential. PUT status: ' + status msg: i18n._('Failed to update Credential. PUT status: ') + status
}); });
}); });
} }

View File

@ -66,14 +66,14 @@ export default
$scope.newLicense.file = JSON.parse(raw.result); $scope.newLicense.file = JSON.parse(raw.result);
} }
catch(err) { 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 { try {
raw.readAsText(event.target.files[0]); raw.readAsText(event.target.files[0]);
} }
catch(err) { 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 // HTML5 spec doesn't provide a way to customize file input css

View File

@ -72,14 +72,14 @@ export default
icon: 'icon-rocket', icon: 'icon-rocket',
mode: 'all', mode: 'all',
ngClick: 'relaunchJob($event, completed_job.id)', ngClick: 'relaunchJob($event, completed_job.id)',
awToolTip: 'Relaunch using the same parameters', awToolTip: i18n._('Relaunch using the same parameters'),
dataPlacement: 'top', dataPlacement: 'top',
ngShow: "!completed_job.type == 'system_job' || completed_job.summary_fields.user_capabilities.start" ngShow: "!completed_job.type == 'system_job' || completed_job.summary_fields.user_capabilities.start"
}, },
"delete": { "delete": {
mode: 'all', mode: 'all',
ngClick: 'deleteJob(completed_job.id)', ngClick: 'deleteJob(completed_job.id)',
awToolTip: 'Delete the job', awToolTip: i18n._('Delete the job'),
dataPlacement: 'top', dataPlacement: 'top',
ngShow: 'completed_job.summary_fields.user_capabilities.delete' ngShow: 'completed_job.summary_fields.user_capabilities.delete'
} }

View File

@ -15,8 +15,7 @@ export default
selectTitle: i18n._('Add Inventories'), selectTitle: i18n._('Add Inventories'),
editTitle: i18n._('Inventories'), editTitle: i18n._('Inventories'),
listTitle: i18n._('Inventories'), listTitle: i18n._('Inventories'),
selectInstructions: "Click on a row to select it, and click Finished when done. Click the <i class=\"icon-plus\"></i> " + 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."), "<i class=\"icon-plus\"></i> "),
"button to create a new inventory.",
index: false, index: false,
hover: true, hover: true,
basePath: 'inventory', basePath: 'inventory',

View File

@ -15,8 +15,7 @@ export default
selectTitle: i18n._('Add Team'), selectTitle: i18n._('Add Team'),
editTitle: i18n._('Teams'), editTitle: i18n._('Teams'),
listTitle: i18n._('Teams'), listTitle: i18n._('Teams'),
selectInstructions: "Click on a row to select it, and click Finished when done. Click the <i class=\"icon-plus\"></i> " + 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."), "<i class=\"icon-plus\"></i> "),
"button to create a new team.",
index: false, index: false,
hover: true, hover: true,

View File

@ -16,8 +16,7 @@ export default
selectTitle: i18n._('Template'), selectTitle: i18n._('Template'),
editTitle: i18n._('Templates'), editTitle: i18n._('Templates'),
listTitle: i18n._('Templates'), listTitle: i18n._('Templates'),
selectInstructions: "Click on a row to select it, and click Finished when done. Use the <i class=\"icon-plus\"></i> " + 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."), "<i class=\"icon-plus\"></i> "),
"button to create a new job template.",
index: false, index: false,
hover: true, hover: true,
@ -62,12 +61,12 @@ export default
buttonContent: i18n._('ADD'), buttonContent: i18n._('ADD'),
options: [ options: [
{ {
optionContent: 'Job Template', optionContent: i18n._('Job Template'),
optionSref: 'templates.addJobTemplate', optionSref: 'templates.addJobTemplate',
ngShow: 'canAddJobTemplate' ngShow: 'canAddJobTemplate'
}, },
{ {
optionContent: 'Workflow Job Template', optionContent: i18n._('Workflow Job Template'),
optionSref: 'templates.addWorkflowJobTemplate', optionSref: 'templates.addWorkflowJobTemplate',
ngShow: 'canAddWorkflowJobTemplate' ngShow: 'canAddWorkflowJobTemplate'
} }

View File

@ -49,7 +49,7 @@ export default
actions: { actions: {
add: { add: {
label: 'Create New', label: i18n._('Create New'),
mode: 'all', // One of: edit, select, all mode: 'all', // One of: edit, select, all
ngClick: 'addUser()', ngClick: 'addUser()',
basePaths: ['organizations', 'users'], // base path must be in list, or action not available basePaths: ['organizations', 'users'], // base path must be in list, or action not available

View File

@ -116,8 +116,8 @@
return {"options": options, "error": error}; return {"options": options, "error": error};
}) })
.catch(function (data) { .catch(function (data) {
ProcessErrors(scope, data.data, data.status, null, { hdr: 'Error!', ProcessErrors(scope, data.data, data.status, null, { hdr: i18n._('Error!'),
msg: 'Failed to get third-party login types. Returned status: ' + data.status }); msg: i18n._('Failed to get third-party login types. Returned status: ') + data.status });
}); });
}; };
}]; }];

View File

@ -18,7 +18,7 @@ export default ['i18n', function(i18n){
iterator: 'notification', iterator: 'notification',
index: false, index: false,
hover: false, hover: false,
emptyListText: "This list is populated by notification templates added from the&nbsp;<a ui-sref='notifications.add'>Notifications</a>&nbsp;section", emptyListText: i18n.sprintf(i18n._("This list is populated by notification templates added from the %sNotifications%s section"), "&nbsp;<a ui-sref='notifications.add'>", "</a>&nbsp;"),
basePath: 'notification_templates', basePath: 'notification_templates',
fields: { fields: {
name: { name: {
@ -60,7 +60,7 @@ export default ['i18n', function(i18n){
}, },
actions: { actions: {
add: { add: {
label: 'Add Notification', label: i18n._('Add Notification'),
mode: 'all', // One of: edit, select, all mode: 'all', // One of: edit, select, all
ngClick: 'addNotificationTemplate()', ngClick: 'addNotificationTemplate()',
awToolTip: i18n._('Create a new notification template'), awToolTip: i18n._('Create a new notification template'),

View File

@ -542,9 +542,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += (field.flag) ? field.flag : "enabled"; html += (field.flag) ? field.flag : "enabled";
html += "\}' aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><div ng-show='" + form.iterator + "." ; html += "\}' aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><div ng-show='" + form.iterator + "." ;
html += (field.flag) ? field.flag : 'enabled'; html += (field.flag) ? field.flag : 'enabled';
html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>ON</div><div ng-show='!" + form.iterator + "." ; html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>" + i18n._("ON") + "</div><div ng-show='!" + form.iterator + "." ;
html += (field.flag) ? field.flag : "enabled"; html += (field.flag) ? field.flag : "enabled";
html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>OFF</div></div></div>"; html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>" + i18n._("OFF") + "</div></div></div>";
} }
return html; return html;
}, },
@ -1041,7 +1041,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages // Add error messages
if (field.required) { if (field.required) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please enter a value.") + "</div>\n"; this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please enter a value.")) + "</div>\n";
} }
html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n"; html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n";
html += "</div>\n"; html += "</div>\n";
@ -1108,7 +1108,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages // Add error messages
if (field.required || field.awRequiredWhen) { if (field.required || field.awRequiredWhen) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">" + (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) { if (field.includePlaybookNotFoundError) {
html += " <span ng-show=\"playbookNotFound\">Playbook {{ job_template_obj.playbook }} not found for project.</span>\n"; html += " <span ng-show=\"playbookNotFound\">Playbook {{ job_template_obj.playbook }} not found for project.</span>\n";
} }
@ -1177,15 +1177,19 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages // Add error messages
if (field.required) { if (field.required) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select a value.") + "</div>\n"; this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select a value.")) + "</div>\n";
} }
if (field.integer) { if (field.integer) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-integer-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.integer\">Please enter a number.</div>\n"; html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-integer-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.integer\">" + i18n._("Please enter a number.") + "</div>\n";
} }
if (field.min !== undefined || field.max !== undefined) { if (field.min !== undefined || field.max !== undefined) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-minmax-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.min || " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-minmax-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.min || " +
this.form.name + '_form.' + fld + ".$error.max\">Please enter a number greater than " + field.min; this.form.name + '_form.' + fld + ".$error.max\">";
html += (field.max !== undefined) ? " and less than " + field.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 += "</div>\n"; html += "</div>\n";
} }
html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n"; html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n";
@ -1210,14 +1214,14 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages // Add error messages
if (field.required) { if (field.required) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select at least one value.") + "</div>\n"; this.form.name + '_form.' + fld + ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select at least one value.")) + "</div>\n";
} }
if (field.integer) { if (field.integer) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-integer-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.integer\">Please select a number.</div>\n"; html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-integer-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.integer\">" + i18n._("Please select a number.") + "</div>\n";
} }
if (field.min || field.max) { if (field.min || field.max) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-minmax-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.min || " + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-minmax-error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$error.min || " +
this.form.name + '_form.' + fld + ".$error.max\">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 + "</div>\n"; field.max + "</div>\n";
} }
html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n"; html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + fld + "_api_error\"></div>\n";
@ -1291,7 +1295,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
if (field.required || field.awRequiredWhen) { if (field.required || field.awRequiredWhen) {
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-required-error\" ng-show=\"" +
this.form.name + '_form.' + fld + ".$dirty && " + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">Please select a value.</div>\n"; this.form.name + '_form.' + fld + ".$error.required\">" + i18n._("Please select a value.") + "</div>\n";
} }
html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" +
fld + "_api_error\"></div>\n"; fld + "_api_error\"></div>\n";
@ -1396,13 +1400,13 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
this.form.name + '_form.' + this.form.name + '_form.' +
field.sourceModel + '_' + field.sourceField + ".$dirty && " + field.sourceModel + '_' + field.sourceField + ".$dirty && " +
this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField +
".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : "Please select a value.") + "</div>\n"; ".$error.required\">" + (field.requiredErrorMsg ? field.requiredErrorMsg : i18n._("Please select a value.")) + "</div>\n";
} }
html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-notfound-error\" ng-show=\"" + html += "<div class=\"error\" id=\"" + this.form.name + "-" + fld + "-notfound-error\" ng-show=\"" +
this.form.name + '_form.' + this.form.name + '_form.' +
field.sourceModel + '_' + field.sourceField + ".$dirty && " + field.sourceModel + '_' + field.sourceField + ".$dirty && " +
this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField + this.form.name + '_form.' + field.sourceModel + '_' + field.sourceField +
".$error.awlookup\">That value was not found. Please enter or select a valid value.</div>\n"; ".$error.awlookup\">" + i18n._("That value was not found. Please enter or select a valid value.") + "</div>\n";
html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + field.sourceModel + '_' + field.sourceField + html += "<div class=\"error api-error\" id=\"" + this.form.name + "-" + fld + "-api-error\" ng-bind=\"" + field.sourceModel + '_' + field.sourceField +
"_api_error\"></div>\n"; "_api_error\"></div>\n";
html += "</div>\n"; html += "</div>\n";
@ -1869,7 +1873,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 // 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 += `<div ng-hide="is_superuser">`; html += `<div ng-hide="is_superuser">`;
html += `<div class="List-noItems" ng-show="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)"> ${emptyListText} </div>`; html += `<div class="List-noItems" ng-show="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)"> ${emptyListText} </div>`;
html += '</div>'; html += '</div>';

File diff suppressed because it is too large Load Diff