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

Mark additional strings for translation.

This commit is contained in:
Bill Nottingham 2016-12-06 11:40:21 -05:00
parent d8ee92aefd
commit 832011aa99
18 changed files with 82 additions and 83 deletions

View File

@ -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: '<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,
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 });
}

View File

@ -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: '<div class="Prompt-bodyQuery">Are you sure you want to delete the user below?</div><div class="Prompt-bodyTarget">' + $filter('sanitize')(name) + '</div>',
hdr: i18n._('Delete'),
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,
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
});
});
}

View File

@ -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: "<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>",
dataTitle: 'Host Enabled',
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: 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'
}
},

View File

@ -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: "<p>" + i18n._("Select the inventory containing the hosts you want this job to manage.") + "</p>",
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: "<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>",
@ -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: '&#43; ADD',
buttonContent: '&#43; ' + i18n._('ADD'),
ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)'
}
},

View File

@ -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',

View File

@ -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: '&#43; ' + i18n._('ADD'),

View File

@ -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

View File

@ -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: '&#43; ADD',
buttonContent: '&#43; '+ i18n._('ADD'),
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
}
},

View File

@ -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
});
});
}

View File

@ -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

View File

@ -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'
}

View File

@ -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 <i class=\"icon-plus\"></i> " +
"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."), "<i class=\"icon-plus\"></i> "),
index: false,
hover: true,
basePath: 'inventory',

View File

@ -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 <i class=\"icon-plus\"></i> " +
"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."), "<i class=\"icon-plus\"></i> "),
index: false,
hover: true,

View File

@ -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 <i class=\"icon-plus\"></i> " +
"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."), "<i class=\"icon-plus\"></i> "),
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'
}

View File

@ -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

View File

@ -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 });
});
};
}];

View File

@ -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&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',
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'),

View File

@ -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 + "'><div ng-show='" + form.iterator + "." ;
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 += "' 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;
},
@ -1041,7 +1041,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages
if (field.required) {
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>\n";
@ -1108,7 +1108,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
// Add error messages
if (field.required || field.awRequiredWhen) {
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) {
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
if (field.required) {
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) {
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) {
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;
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 += "</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
if (field.required) {
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) {
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) {
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";
}
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) {
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\">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=\"" +
fld + "_api_error\"></div>\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.") + "</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=\"" +
this.form.name + '_form.' +
field.sourceModel + '_' + field.sourceField + ".$dirty && " +
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 +
"_api_error\"></div>\n";
html += "</div>\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 += `<div ng-hide="is_superuser">`;
html += `<div class="List-noItems" ng-show="${itm}.length === 0 && (${collection.iterator}_searchTags | isEmpty)"> ${emptyListText} </div>`;
html += '</div>';