Marking strings for translation. This covers a lot of breadcrumbs as well as login, activity stream and project list

This commit is contained in:
Michael Abashian 2017-01-28 10:28:26 -05:00
parent e5f7556fc2
commit 131a0edfb4
30 changed files with 147 additions and 111 deletions

View File

@ -1,12 +1,13 @@
import {templateUrl} from '../shared/template-url/template-url.factory';
import controller from './about.controller';
import { N_ } from '../i18n';
export default {
name: 'setup.about',
route: '/about',
controller: controller,
ncyBreadcrumb: {
label: "ABOUT"
label: N_("ABOUT")
},
onExit: function(){
// hacky way to handle user browsing away via URL bar

View File

@ -4,6 +4,8 @@
* All Rights Reserved
*************************************************/
import { N_ } from '../i18n';
export default {
name: 'activityStream',
route: '/activity_stream?target&id',
@ -22,7 +24,7 @@ export default {
}
},
ncyBreadcrumb: {
label: "ACTIVITY STREAM"
label: N_("ACTIVITY STREAM")
},
onExit: function() {
$('#stream-detail-modal').modal('hide');

View File

@ -1,6 +1,6 @@
export default
['templateUrl', '$state', 'FeaturesService', 'ProcessErrors','$rootScope', 'Store', 'Empty', '$window', 'BreadCrumbService',
function(templateUrl, $state, FeaturesService, ProcessErrors, $rootScope, Store, Empty, $window, BreadCrumbService) {
['templateUrl', '$state', 'FeaturesService', 'ProcessErrors','$rootScope', 'Store', 'Empty', '$window', 'BreadCrumbService', 'i18n',
function(templateUrl, $state, FeaturesService, ProcessErrors, $rootScope, Store, Empty, $window, BreadCrumbService, i18n) {
return {
restrict: 'E',
templateUrl: templateUrl('bread-crumb/bread-crumb'),
@ -103,7 +103,7 @@ export default
if(features){
scope.loadingLicense = false;
scope.activityStreamActive = (toState.name === 'activityStream') ? true : false;
scope.activityStreamTooltip = (toState.name === 'activityStream') ? 'Hide Activity Stream' : 'View Activity Stream';
scope.activityStreamTooltip = (toState.name === 'activityStream') ? i18n._('Hide Activity Stream') : i18n._('View Activity Stream');
scope.showActivityStreamButton = (FeaturesService.featureEnabled('activity_streams') || toState.name ==='activityStream') ? true : false;
}
}

View File

@ -12,6 +12,7 @@
import ConfigurationJobsController from './jobs-form/configuration-jobs.controller';
import ConfigurationSystemController from './system-form/configuration-system.controller';
import ConfigurationUiController from './ui-form/configuration-ui.controller';
import { N_ } from '../i18n';
export default {
name: 'configuration',
@ -26,7 +27,7 @@
},
ncyBreadcrumb: {
parent: 'setup',
label: "Edit Configuration"
label: N_("Edit Configuration")
},
controller: ConfigurationController,
resolve: {

View File

@ -9,6 +9,7 @@ import form from './dashboard-hosts.form';
import listController from './dashboard-hosts-list.controller';
import editController from './dashboard-hosts-edit.controller';
import service from './dashboard-hosts.service';
import { N_ } from '../../i18n';
export default
angular.module('dashboardHosts', [])
@ -51,7 +52,7 @@ angular.module('dashboardHosts', [])
},
ncyBreadcrumb: {
parent: 'dashboard',
label: "HOSTS"
label: N_("HOSTS")
},
})
});

View File

@ -12,45 +12,45 @@
export default
angular.module('ActivityStreamHelper', ['Utilities'])
.factory('GetTargetTitle', [
function () {
.factory('GetTargetTitle', ['i18n',
function (i18n) {
return function (target) {
var rtnTitle = 'ALL ACTIVITY';
var rtnTitle = i18n._('ALL ACTIVITY');
switch(target) {
case 'project':
rtnTitle = 'PROJECTS';
rtnTitle = i18n._('PROJECTS');
break;
case 'inventory':
rtnTitle = 'INVENTORIES';
rtnTitle = i18n._('INVENTORIES');
break;
case 'credential':
rtnTitle = 'CREDENTIALS';
rtnTitle = i18n._('CREDENTIALS');
break;
case 'user':
rtnTitle = 'USERS';
rtnTitle = i18n._('USERS');
break;
case 'team':
rtnTitle = 'TEAMS';
rtnTitle = i18n._('TEAMS');
break;
case 'organization':
rtnTitle = 'ORGANIZATIONS';
rtnTitle = i18n._('ORGANIZATIONS');
break;
case 'job':
rtnTitle = 'JOBS';
rtnTitle = i18n._('JOBS');
break;
case 'inventory_script':
rtnTitle = 'INVENTORY SCRIPTS';
rtnTitle = i18n._('INVENTORY SCRIPTS');
break;
case 'schedule':
rtnTitle = 'SCHEDULES';
rtnTitle = i18n._('SCHEDULES');
break;
case 'host':
rtnTitle = 'HOSTS';
rtnTitle = i18n._('HOSTS');
break;
case 'template':
rtnTitle = 'TEMPLATES';
rtnTitle = i18n._('TEMPLATES');
break;
}

View File

@ -12,6 +12,7 @@ import inventoryManageListRoute from './manage/inventory-manage.route';
import { copyMoveGroupRoute, copyMoveHostRoute } from './manage/copy-move/copy-move.route';
import adHocRoute from './manage/adhoc/adhoc.route';
import { templateUrl } from '../shared/template-url/template-url.factory';
import { N_ } from '../i18n';
export default
angular.module('inventory', [
inventoryAdd.name,
@ -55,7 +56,7 @@ angular.module('inventory', [
searchPrefix: 'schedule',
ncyBreadcrumb: {
parent: 'inventoryManage.editGroup({group_id: parentObject.id})',
label: 'SCHEDULES'
label: N_('SCHEDULES')
},
resolve: {
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath', 'groupData',
@ -89,7 +90,7 @@ angular.module('inventory', [
'@': {
templateProvider: function(SchedulesList, generateList, ParentObject) {
// include name of parent resource in listTitle
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Schedules');
let html = generateList.build({
list: SchedulesList,
mode: 'edit'
@ -106,7 +107,7 @@ angular.module('inventory', [
name: 'inventoryManage.editGroup.schedules.add',
url: '/add',
ncyBreadcrumb: {
label: "CREATE SCHEDULE"
label: N_("CREATE SCHEDULE")
},
views: {
'form': {

View File

@ -5,6 +5,7 @@
*************************************************/
import {templateUrl} from '../../../shared/template-url/template-url.factory';
import { N_ } from '../../../i18n';
export default {
url: '/adhoc',
@ -22,6 +23,6 @@ export default {
}
},
ncyBreadcrumb: {
label: "RUN COMMAND"
label: N_("RUN COMMAND")
}
};

View File

@ -4,6 +4,7 @@
* All Rights Reserved
*************************************************/
import {templateUrl} from '../../../shared/template-url/template-url.factory';
import { N_ } from '../../../i18n';
import CopyMoveGroupsController from './copy-move-groups.controller';
import CopyMoveHostsController from './copy-move-hosts.controller';
@ -25,7 +26,7 @@ var copyMoveGroupRoute = {
}
},
ncyBreadcrumb: {
label: "COPY OR MOVE {{item.name}}"
label: N_("COPY OR MOVE") + " {{item.name}}"
},
resolve: {
Dataset: ['CopyMoveGroupList', 'QuerySet', '$stateParams', 'GetBasePath', 'group',
@ -61,7 +62,7 @@ var copyMoveHostRoute = {
url: '/copy-move-host/{host_id}',
searchPrefix: 'copy',
ncyBreadcrumb: {
label: "COPY OR MOVE {{item.name}}"
label: N_("COPY OR MOVE") + " {{item.name}}"
},
resolve: {
Dataset: ['CopyMoveGroupList', 'QuerySet', '$stateParams', 'GetBasePath',

View File

@ -9,6 +9,7 @@ import inventoryScriptsAdd from './add/main';
import inventoryScriptsEdit from './edit/main';
import list from './inventory-scripts.list';
import form from './inventory-scripts.form';
import { N_ } from '../i18n';
export default
angular.module('inventoryScripts', [
@ -62,7 +63,7 @@ angular.module('inventoryScripts', [
},
ncyBreadcrumb: {
parent: 'setup',
label: 'INVENTORY SCRIPTS'
label: N_('INVENTORY SCRIPTS')
}
})
});

View File

@ -5,6 +5,7 @@
*************************************************/
import {templateUrl} from '../shared/template-url/template-url.factory';
import { N_ } from '../i18n';
export default {
name: 'license',
@ -14,7 +15,7 @@ export default {
data: {},
ncyBreadcrumb: {
parent: 'setup',
label: 'LICENSE'
label: N_('LICENSE')
},
resolve: {
features: ['CheckLicense', '$rootScope',

View File

@ -7,7 +7,8 @@
export default
angular.module('SchedulesListDefinition', [])
.value('SchedulesList', {
.factory('StreamList', ['i18n', function(i18n) {
return {
name: 'schedules',
iterator: 'schedule',
@ -30,22 +31,22 @@ export default
},
name: {
key: true,
label: 'Name',
label: i18n._('Name'),
ngClick: "editSchedule(schedule)",
columnClass: "col-md-3 col-sm-3 col-xs-6"
},
dtstart: {
label: 'First Run',
label: i18n._('First Run'),
filter: "longDate",
columnClass: "List-staticColumn--schedulerTime hidden-sm hidden-xs"
},
next_run: {
label: 'Next Run',
label: i18n._('Next Run'),
filter: "longDate",
columnClass: "List-staticColumn--schedulerTime hidden-xs"
},
dtend: {
label: 'Final Run',
label: i18n._('Final Run'),
filter: "longDate",
columnClass: "List-staticColumn--schedulerTime hidden-xs"
},
@ -54,45 +55,45 @@ export default
actions: {
refresh: {
mode: 'all',
awToolTip: "Refresh the page",
awToolTip: i18n._("Refresh the page"),
ngClick: "refreshSchedules()",
actionClass: 'btn List-buttonDefault',
ngShow: "socketStatus == 'error'",
buttonContent: 'REFRESH'
buttonContent: i18n._('REFRESH')
},
add: {
mode: 'all',
ngClick: 'addSchedule()',
awToolTip: 'Add a new schedule',
awToolTip: i18n._('Add a new schedule'),
actionClass: 'btn List-buttonSubmit',
buttonContent: '&#43; ADD',
buttonContent: '&#43; ' + i18n._('ADD'),
ngShow: 'canAdd'
}
},
fieldActions: {
edit: {
label: 'Edit',
label: i18n._('Edit'),
ngClick: "editSchedule(schedule)",
icon: 'icon-edit',
awToolTip: 'Edit schedule',
awToolTip: i18n._('Edit schedule'),
dataPlacement: 'top',
ngShow: 'schedule.summary_fields.user_capabilities.edit'
},
view: {
label: 'View',
label: i18n._('View'),
ngClick: "editSchedule(schedule)",
awToolTip: 'View schedule',
awToolTip: i18n._('View schedule'),
dataPlacement: 'top',
ngShow: '!schedule.summary_fields.user_capabilities.edit'
},
"delete": {
label: 'Delete',
label: i18n._('Delete'),
ngClick: "deleteSchedule(schedule.id)",
icon: 'icon-trash',
awToolTip: 'Delete schedule',
awToolTip: i18n._('Delete schedule'),
dataPlacement: 'top',
ngShow: 'schedule.summary_fields.user_capabilities.delete'
}
}
});
};}]);

View File

@ -7,15 +7,16 @@
export default
angular.module('StreamListDefinition', [])
.value('StreamList', {
.factory('StreamList', ['i18n', function(i18n) {
return {
name: 'activities',
iterator: 'activity',
basePath: 'activity_stream',
editTitle: 'Activity Stream',
listTitle: 'Activity Stream<span ng-show="streamSubTitle"><div class="List-titleLockup"></div>{{streamSubTitle}}<span>',
editTitle: i18n._('Activity Stream'),
listTitle: '<span translate>Activity Stream</span><span ng-show="streamSubTitle"><div class="List-titleLockup"></div>{{streamSubTitle}}<span>',
listTitleBadge: false,
emptyListText: 'There are no events to display at this time',
emptyListText: i18n._('There are no events to display at this time'),
selectInstructions: '',
index: false,
hover: true,
@ -24,7 +25,7 @@ export default
fields: {
timestamp: {
label: 'Time',
label: i18n._('Time'),
key: true,
desc: true,
noLink: true,
@ -32,14 +33,14 @@ export default
columnClass: 'col-lg-3 col-md-2 col-sm-3 col-xs-3'
},
user: {
label: 'Initiated by',
label: i18n._('Initiated by'),
ngBindHtml: 'activity.user', // @todo punch monkey
sourceModel: 'actor',
sourceField: 'username',
columnClass: 'col-lg-3 col-md-3 col-sm-3 col-xs-3'
},
description: {
label: 'Event',
label: i18n._('Event'),
ngBindHtml: 'activity.description', // @todo punch monkey
nosort: true,
columnClass: 'ActivityStream-eventColumnHeader col-lg-5 col-md-6 col-sm-4 col-xs-4'
@ -50,7 +51,7 @@ export default
refresh: {
mode: 'all',
id: 'activity-stream-refresh-btn',
awToolTip: "Refresh the page",
awToolTip: i18n._("Refresh the page"),
ngClick: "refreshStream()",
actionClass: 'btn List-buttonDefault ActivityStream-refreshButton',
buttonContent: 'REFRESH'
@ -62,13 +63,13 @@ export default
columnClass: 'col-lg-1 col-md-1 col-sm-2 col-xs-2',
view: {
label: 'View',
label: i18n._('View'),
ngClick: "showDetail(activity.id)",
icon: 'fa-zoom-in',
"class": 'btn-default btn-xs',
awToolTip: 'View event details',
awToolTip: i18n._('View event details'),
dataPlacement: 'top'
}
}
});
};}]);

View File

@ -86,7 +86,7 @@
</div>
</div>
</form>
<div id="login_modal_notice" class="LoginModalNotice" ng-if="customLoginInfoPresent"><div class="LoginModalNotice-title">NOTICE</div>{{ customLoginInfo | sanitize }}</div>
<div id="login_modal_notice" class="LoginModalNotice" ng-if="customLoginInfoPresent"><div class="LoginModalNotice-title" translate>NOTICE</div>{{ customLoginInfo | sanitize }}</div>
</div>
<div class="LoginModal-footer">
<div class="LoginModal-footerBlock">

View File

@ -4,6 +4,8 @@
* All Rights Reserved
*************************************************/
import { N_ } from '../../i18n';
export default {
name: 'managementJobsList.notifications',
route: '/:management_id/notifications',
@ -16,7 +18,7 @@ export default {
controller: 'managementJobsNotificationsController',
templateProvider: function(NotificationsList, generateList, ParentObject) {
// include name of parent resource in listTitle
NotificationsList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Notifications`;
NotificationsList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Notifications');
let html = generateList.build({
list: NotificationsList,
mode: 'edit'
@ -41,6 +43,6 @@ export default {
},
ncyBreadcrumb: {
parent: 'managementJobsList',
label: 'NOTIFICATIONS'
label: N_('NOTIFICATIONS')
}
};

View File

@ -9,6 +9,7 @@ import { templateUrl } from '../../shared/template-url/template-url.factory';
import controller from '../../scheduler/schedulerList.controller';
import addController from '../../scheduler/schedulerAdd.controller';
import editController from '../../scheduler/schedulerEdit.controller';
import { N_ } from '../../i18n';
export default
angular.module('managementJobScheduler', [])
@ -22,13 +23,13 @@ angular.module('managementJobScheduler', [])
route: '/management_jobs/:id/schedules',
ncyBreadcrumb: {
parent: 'managementJobsList',
label: 'SCHEDULES'
label: N_('SCHEDULES')
},
views: {
'@': {
templateProvider: function(SchedulesList, generateList, ParentObject) {
// include name of parent resource in listTitle
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Schedules');
let html = generateList.build({
list: SchedulesList,
mode: 'edit'
@ -70,7 +71,7 @@ angular.module('managementJobScheduler', [])
route: '/add',
ncyBreadcrumb: {
parent: 'managementJobSchedules',
label: 'CREATE SCHEDULED JOB'
label: N_('CREATE SCHEDULED JOB')
},
views: {
'form': {
@ -84,7 +85,7 @@ angular.module('managementJobScheduler', [])
route: '/edit/:schedule_id',
ncyBreadcrumb: {
parent: 'managementJobSchedules',
label: 'EDIT SCHEDULED JOB'
label: N_('EDIT SCHEDULED JOB')
},
views: {
'form': {

View File

@ -18,7 +18,7 @@
<div class="form-group SchedulerForm-formGroup">
<label class="Form-inputLabel">
<span class="red-text">*</span>
Name
<span translate>Name</span>
</label>
<input
type="text"
@ -30,14 +30,14 @@
ng-model="schedulerName" required
placeholder="Schedule name">
<div class="error"
ng-show="scheduler_form.$dirty && scheduler_form.schedulerName.$error.required">
ng-show="scheduler_form.$dirty && scheduler_form.schedulerName.$error.required" translate>
A schedule name is required.
</div>
</div>
<div class="form-group SchedulerForm-formGroup">
<label class="Form-inputLabel">
<span class="red-text">*</span>
Start Date
<span translate>Start Date</span>
</label>
<div class="input-group Form-inputGroup SchedulerForm-inputGroup--date">
<scheduler-date-picker date="schedulerStartDt">
@ -51,7 +51,7 @@
<div class="form-group SchedulerForm-formGroup">
<label class="Form-inputLabel">
<span class="red-text">*</span>
Start Time
<span translate>Start Time</span>
<span class="fmt-help"
ng-show="schedulerShowTimeZone">
(HH24:MM:SS)
@ -117,7 +117,7 @@
</div> -->
</div>
<div class="error"
ng-show="scheduler_startTime_error">
ng-show="scheduler_startTime_error" translate>
The time must be in HH24:MM:SS format.
</div>
</div>
@ -125,7 +125,7 @@
ng-show="schedulerShowTimeZone">
<label class="Form-inputLabel">
<span class="red-text">*</span>
Local Time Zone
<span translate>Local Time Zone</span>
</label>
<select
class="MakeSelect2"
@ -140,7 +140,7 @@
<div class="form-group SchedulerForm-formGroup">
<label class="Form-inputLabel">
<span class="red-text">*</span>
Repeat frequency
<span translate>Repeat frequency</span>
</label>
<select name="schedulerFrequency"
id="schedulerFrequency"
@ -157,12 +157,12 @@
<div class="form-group SchedulerForm-formGroup" ng-if="cleanupJob && !isFactCleanup">
<label class="Form-inputLabel"><span class="red-text">*</span> Days of data to keep</label>
<input type="number" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" name="schedulerPurgeDays" id="schedulerPurgeDays" min="1" aw-spinner="schedulerPurgeDays" ng-model="schedulerPurgeDays" required placeholder="Days of data to keep">
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$dirty && scheduler_form.schedulerPurgeDays.$error.required">A value is required.</div>
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$error.number">This is not a valid number.</div>
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$dirty && scheduler_form.schedulerPurgeDays.$error.required" translate>A value is required.</div>
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$error.number" translate>This is not a valid number.</div>
</div>
<div class="RepeatFrequencyOptions-label"
ng-show="schedulerFrequency.value && schedulerFrequency.value !== 'none'">
Frequency Details</div>
<span translate>Frequency Details</span></div>
<div class="RepeatFrequencyOptions Form"
ng-show="schedulerFrequency.value && schedulerFrequency.value !== 'none'">
<div class="form-group

View File

@ -15,6 +15,7 @@ import notificationsList from './notifications.list';
import toggleNotification from './shared/toggle-notification.factory';
import notificationsListInit from './shared/notification-list-init.factory';
import typeChange from './shared/type-change.service';
import { N_ } from '../i18n';
export default
angular.module('notifications', [
@ -39,7 +40,7 @@ angular.module('notifications', [
url: '/notification_templates',
ncyBreadcrumb: {
parent: 'setup',
label: "NOTIFICATIONS"
label: N_("NOTIFICATIONS")
},
lazyLoad: () => stateDefinitions.generateTree({
parent: 'notifications', // top-most node in the generated tree
@ -84,7 +85,7 @@ angular.module('notifications', [
},
ncyBreadcrumb: {
parent: 'setup',
name: 'NOTIFICATIONS'
name: N_('NOTIFICATIONS')
}
})
});

View File

@ -5,7 +5,7 @@
<div class="AddUsers-header">
<div class="List-header">
<div class="List-title">
<div class="List-titleText ng-binding">{{ $parent.organization_name }}<div class="List-titleLockup"></div>Add {{ addType | capitalize}}
<div class="List-titleText ng-binding">{{ $parent.organization_name }}<div class="List-titleLockup"></div><span translate>Add</span> {{ addType | capitalize}}
</div>
</div>
<div class="Form-exitHolder">

View File

@ -10,6 +10,7 @@ import OrganizationsJobTemplates from './controllers/organizations-job-templates
import OrganizationsProjects from './controllers/organizations-projects.controller';
import OrganizationsTeams from './controllers/organizations-teams.controller';
import OrganizationsUsers from './controllers/organizations-users.controller';
import { N_ } from '../../i18n';
export default [{
name: 'organizations.users',
@ -55,7 +56,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "USERS"
label: N_("USERS")
},
data: {
@ -128,7 +129,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "TEAMS"
label: N_("TEAMS")
},
resolve: {
features: ['FeaturesService', function(FeaturesService) {
@ -174,7 +175,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "INVENTORIES"
label: N_("INVENTORIES")
},
resolve: {
features: ['FeaturesService', function(FeaturesService) {
@ -225,7 +226,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "PROJECTS"
label: N_("PROJECTS")
},
resolve: {
features: ['FeaturesService', function(FeaturesService) {
@ -283,7 +284,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "JOB TEMPLATES"
label: N_("JOB TEMPLATES")
},
resolve: {
features: ['FeaturesService', function(FeaturesService) {
@ -359,7 +360,7 @@ export default [{
},
ncyBreadcrumb: {
parent: "organizations.edit",
label: "ADMINS"
label: N_("ADMINS")
},
resolve: {
features: ['FeaturesService', function(FeaturesService) {

View File

@ -10,6 +10,7 @@ import OrganizationsAdd from './add/organizations-add.controller';
import OrganizationsEdit from './edit/organizations-edit.controller';
import organizationsLinkout from './linkout/main';
import OrganizationsLinkoutStates from './linkout/organizations-linkout.route';
import { N_ } from '../i18n';
export default
@ -48,7 +49,7 @@ angular.module('Organizations', [
},
ncyBreadcrumb: {
parent: 'setup',
label: 'ORGANIZATIONS'
label: N_('ORGANIZATIONS')
},
// concat manually-defined state definitions with generated defintions
}).then((generated) => {

View File

@ -1,6 +1,7 @@
import { templateUrl } from '../shared/template-url/template-url.factory';
import { PortalModeJobTemplatesController } from './portal-mode-job-templates.controller';
import { PortalModeJobsController } from './portal-mode-jobs.controller';
import { N_ } from '../i18n';
// Using multiple named views requires a parent layout
// https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views
@ -8,7 +9,7 @@ export default {
name: 'portalMode',
url: '/portal?{group_search:queryset}{host_search:queryset}',
ncyBreadcrumb: {
label: 'MY VIEW'
label: N_('MY VIEW')
},
params: {
job_search: {

View File

@ -9,6 +9,7 @@ import addController from './schedulerAdd.controller';
import editController from './schedulerEdit.controller';
import {templateUrl} from '../shared/template-url/template-url.factory';
import schedulerDatePicker from './schedulerDatePicker.directive';
import { N_ } from '../i18n';
export default
angular.module('scheduler', [])
@ -32,7 +33,7 @@ export default
},
ncyBreadcrumb: {
parent: 'templates.editJobTemplate({job_template_id: parentObject.id})',
label: 'SCHEDULES'
label: N_('SCHEDULES')
},
resolve: {
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath',
@ -63,7 +64,7 @@ export default
'@': {
templateProvider: function(SchedulesList, generateList, ParentObject){
// include name of parent resource in listTitle
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Schedules');
let html = generateList.build({
list: SchedulesList,
mode: 'edit'
@ -86,7 +87,7 @@ export default
},
ncyBreadcrumb: {
parent: 'jobTemplateSchedules',
label: 'CREATE SCHEDULE'
label: N_('CREATE SCHEDULE')
}
});
$stateExtender.addState({
@ -118,7 +119,7 @@ export default
},
ncyBreadcrumb: {
parent: 'templates.editWorkflowJobTemplate({workflow_job_template_id: parentObject.id})',
label: 'SCHEDULES'
label: N_('SCHEDULES')
},
resolve: {
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath',
@ -149,7 +150,7 @@ export default
'@': {
templateProvider: function(SchedulesList, generateList, ParentObject){
// include name of parent resource in listTitle
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Schedules');
let html = generateList.build({
list: SchedulesList,
mode: 'edit'
@ -172,7 +173,7 @@ export default
},
ncyBreadcrumb: {
parent: 'workflowJobTemplateSchedules',
label: 'CREATE SCHEDULE'
label: N_('CREATE SCHEDULE')
}
});
$stateExtender.addState({
@ -201,7 +202,7 @@ export default
},
ncyBreadcrumb: {
parent: 'projects.edit({project_id: parentObject.id})',
label: 'SCHEDULES'
label: N_('SCHEDULES')
},
resolve: {
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath',
@ -232,7 +233,7 @@ export default
'@': {
templateProvider: function(SchedulesList, generateList, ParentObject){
// include name of parent resource in listTitle
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>` + N_('Schedules');
let html = generateList.build({
list: SchedulesList,
mode: 'edit'
@ -249,7 +250,7 @@ export default
name: 'projectSchedules.add',
route: '/add',
ncyBreadcrumb: {
label: 'CREATE SCHEDULE'
label: N_('CREATE SCHEDULE')
},
views: {
'form': {
@ -289,7 +290,7 @@ export default
},
ncyBreadcrumb: {
parent: 'jobs',
label: 'SCHEDULED'
label: N_('SCHEDULED')
},
resolve: {
SchedulesList: ['ScheduledJobsList', function(list){

View File

@ -1,10 +1,11 @@
import {templateUrl} from '../shared/template-url/template-url.factory';
import { N_ } from '../i18n';
export default {
name: 'setup',
route: '/setup',
ncyBreadcrumb: {
label: "SETTINGS"
label: N_("SETTINGS")
},
templateUrl: templateUrl('setup-menu/setup-menu'),
controller: function(orgAdmin, $scope){

View File

@ -30,15 +30,15 @@
</a>
</li>
</ul>
<span class="Paginate-pager--pageof">Page
<span class="Paginate-pager--pageof" translate>Page
<span id="current-page">{{current()}}</span> of
<span id="total-pages">{{last()}}</span>
</span>
</div>
<div class="Paginate-total page-label" ng-hide="dataCount === 0">
<span>ITEMS&nbsp;
<span translate>ITEMS&nbsp;
<span>{{dataRange}}</span>
<span>of {{dataCount()}}</span>
<span translate>of {{dataCount()}}</span>
</span>
</div>
</div>

View File

@ -1,5 +1,5 @@
export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', 'QuerySet', 'SmartSearchService',
function($stateParams, $scope, $state, QuerySet, GetBasePath, qs, SmartSearchService) {
export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', 'QuerySet', 'SmartSearchService', 'i18n',
function($stateParams, $scope, $state, QuerySet, GetBasePath, qs, SmartSearchService, i18n) {
let path, relations,
defaults,
@ -35,6 +35,7 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
$scope.options = data.options.data;
$scope.$emit(`${$scope.list.iterator}_options`, data.options);
});
$scope.searchPlaceholder = $scope.disableSearch ? i18n._('Cannot search running job') : i18n._('Search');
function compareParams(a, b) {
for (let key in a) {
@ -73,6 +74,15 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
});
$scope.$on('$destroy', stateChangeSuccessListener);
$scope.$watch('disableSearch', function(disableSearch){
if(disableSearch) {
$scope.searchPlaceholder = i18n._('Cannot search running job');
}
else {
$scope.searchPlaceholder = i18n._('Search');
}
});
}
// Removes state definition defaults and pagination terms

View File

@ -4,14 +4,14 @@
<div class="SmartSearch-searchTermContainer">
<!-- string search input -->
<form name="smartSearch" class="SmartSearch-form" aw-enter-key="add(searchTerm)" novalidate>
<input class="SmartSearch-input" ng-model="searchTerm" placeholder="{{disableSearch ? 'Cannot search running job' : 'Search'}}"
<input class="SmartSearch-input" ng-model="searchTerm" placeholder="{{searchPlaceholder}}"
ng-disabled="disableSearch">
</form>
<div type="submit" class="SmartSearch-searchButton" ng-disabled="!searchTerm" ng-click="add(searchTerm)">
<i class="fa fa-search"></i>
</div>
</div>
<div class="SmartSearch-keyToggle btn" ng-class="{'is-active': showKeyPane}" ng-click="toggleKeyPane()">
<div class="SmartSearch-keyToggle btn" ng-class="{'is-active': showKeyPane}" ng-click="toggleKeyPane()" translate>
Key
</div>
</div>
@ -28,7 +28,7 @@
<span class="SmartSearch-name">{{tag}}</span>
</div>
</div>
<a href class="SmartSearch-clearAll" ng-click="clearAll()" ng-show="!(searchTags | isEmpty)">CLEAR ALL</a>
<a href class="SmartSearch-clearAll" ng-click="clearAll()" ng-show="!(searchTags | isEmpty)" translate>CLEAR ALL</a>
</div>
</div>
</div>
@ -37,7 +37,7 @@
<div class="SmartSearch-keyRow">
<div class="SmartSearch-examples">
<div class="SmartSearch-examples--title">
<b>EXAMPLES:</b>
<b translate>EXAMPLES:</b>
</div>
<div class="SmartSearch-examples--search">name:foo</div>
<div class="SmartSearch-examples--search">organization.name:Default</div>
@ -45,13 +45,13 @@
</div>
</div>
<div class="SmartSearch-keyRow">
<b>FIELDS:</b> <span ng-repeat="(key,value) in model.base">{{ key }}<span ng-if="!$last">, </span></span>
<b translate>FIELDS:</b> <span ng-repeat="(key,value) in model.base">{{ key }}<span ng-if="!$last">, </span></span>
</div>
<div class="SmartSearch-keyRow">
<b>RELATED FIELDS:</b> <span ng-repeat="relation in model.related">{{ relation }}<span ng-if="!$last">, </span></span>
<b translate>RELATED FIELDS:</b> <span ng-repeat="relation in model.related">{{ relation }}<span ng-if="!$last">, </span></span>
</div>
<div class="SmartSearch-keyRow">
<b>ADDITIONAL INFORMATION:</b> <span>For additional information on advanced search search syntax please see the Ansible Tower documentation.</span>
<b translate>ADDITIONAL INFORMATION:</b> <span translate>For additional information on advanced search search syntax please see the Ansible Tower documentation.</span>
</div>
</div>
</div>

View File

@ -9,6 +9,8 @@
* generateLookupNodes - Attaches to a form node. Builds an abstract '*.lookup' node with field-specific 'lookup.*' children e.g. {name: 'projects.add.lookup.organizations', ...}
*/
import { N_ } from '../i18n';
export default ['$injector', '$stateExtender', '$log', function($injector, $stateExtender, $log) {
return {
/**
@ -150,7 +152,7 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat
url: url,
ncyBreadcrumb: {
[params.parent ? 'parent' : null]: `${params.parent}`,
label: `CREATE ${form.breadcrumbName || form.name}`
label: N_('CREATE') + ` ${form.breadcrumbName || form.name}`
},
views: {
'form': {
@ -492,7 +494,7 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat
// }
return state;
}
function buildRbacUserDirective() {
let states = [];

View File

@ -5,6 +5,7 @@
*************************************************/
import {templateUrl} from '../shared/template-url/template-url.factory';
import { N_ } from '../i18n';
export default {
name: 'systemTracking',
@ -14,7 +15,7 @@ export default {
params: {hosts: null, inventory: null},
reloadOnSearch: false,
ncyBreadcrumb: {
label: "SYSTEM TRACKING"
label: N_("SYSTEM TRACKING")
},
resolve: {
moduleOptions:

View File

@ -4,11 +4,13 @@
* All Rights Reserved
*************************************************/
import { N_ } from '../../i18n';
export default {
name: 'templates',
route: '/templates',
ncyBreadcrumb: {
label: "TEMPLATES"
label: N_("TEMPLATES")
},
data: {
activityStream: true,