From 131a0edfb4e306574b5dd0fdd86badb0792e35dd Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Sat, 28 Jan 2017 10:28:26 -0500 Subject: [PATCH] Marking strings for translation. This covers a lot of breadcrumbs as well as login, activity stream and project list --- awx/ui/client/src/about/about.route.js | 3 +- .../activity-stream/activitystream.route.js | 4 ++- .../src/bread-crumb/bread-crumb.directive.js | 6 ++-- .../src/configuration/configuration.route.js | 3 +- awx/ui/client/src/dashboard/hosts/main.js | 3 +- awx/ui/client/src/helpers/ActivityStream.js | 28 ++++++++-------- awx/ui/client/src/inventories/main.js | 7 ++-- .../inventories/manage/adhoc/adhoc.route.js | 3 +- .../manage/copy-move/copy-move.route.js | 5 +-- awx/ui/client/src/inventory-scripts/main.js | 3 +- awx/ui/client/src/license/license.route.js | 3 +- awx/ui/client/src/lists/Schedules.js | 33 ++++++++++--------- awx/ui/client/src/lists/Streams.js | 23 ++++++------- .../login/loginModal/loginModal.partial.html | 2 +- .../notifications/notification.route.js | 6 ++-- .../src/management-jobs/scheduler/main.js | 9 ++--- .../scheduler/schedulerForm.partial.html | 20 +++++------ awx/ui/client/src/notifications/main.js | 5 +-- .../linkout/addUsers/addUsers.partial.html | 2 +- .../linkout/organizations-linkout.route.js | 13 ++++---- awx/ui/client/src/organizations/main.js | 3 +- .../src/portal-mode/portal-mode.route.js | 3 +- awx/ui/client/src/scheduler/main.js | 21 ++++++------ awx/ui/client/src/setup-menu/setup.route.js | 3 +- .../src/shared/paginate/paginate.partial.html | 6 ++-- .../smart-search/smart-search.controller.js | 14 ++++++-- .../smart-search/smart-search.partial.html | 14 ++++---- .../src/shared/stateDefinitions.factory.js | 6 ++-- .../system-tracking/system-tracking.route.js | 3 +- .../templates/list/templates-list.route.js | 4 ++- 30 files changed, 147 insertions(+), 111 deletions(-) diff --git a/awx/ui/client/src/about/about.route.js b/awx/ui/client/src/about/about.route.js index 475cf1aea0..639c5ee975 100644 --- a/awx/ui/client/src/about/about.route.js +++ b/awx/ui/client/src/about/about.route.js @@ -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 diff --git a/awx/ui/client/src/activity-stream/activitystream.route.js b/awx/ui/client/src/activity-stream/activitystream.route.js index 73877d5f1b..5b99ce55bd 100644 --- a/awx/ui/client/src/activity-stream/activitystream.route.js +++ b/awx/ui/client/src/activity-stream/activitystream.route.js @@ -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'); diff --git a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js index 3c64a0b701..979ebd69d5 100644 --- a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js +++ b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js @@ -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; } } diff --git a/awx/ui/client/src/configuration/configuration.route.js b/awx/ui/client/src/configuration/configuration.route.js index 7bf829ab53..991c052971 100644 --- a/awx/ui/client/src/configuration/configuration.route.js +++ b/awx/ui/client/src/configuration/configuration.route.js @@ -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: { diff --git a/awx/ui/client/src/dashboard/hosts/main.js b/awx/ui/client/src/dashboard/hosts/main.js index 8b383ed5bb..84d04fa8ad 100644 --- a/awx/ui/client/src/dashboard/hosts/main.js +++ b/awx/ui/client/src/dashboard/hosts/main.js @@ -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") }, }) }); diff --git a/awx/ui/client/src/helpers/ActivityStream.js b/awx/ui/client/src/helpers/ActivityStream.js index 37da4f2857..065d466ba5 100644 --- a/awx/ui/client/src/helpers/ActivityStream.js +++ b/awx/ui/client/src/helpers/ActivityStream.js @@ -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; } diff --git a/awx/ui/client/src/inventories/main.js b/awx/ui/client/src/inventories/main.js index ac031283cd..fd5c8be173 100644 --- a/awx/ui/client/src/inventories/main.js +++ b/awx/ui/client/src/inventories/main.js @@ -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}
Schedules`; + SchedulesList.listTitle = `${ParentObject.name}
` + 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': { diff --git a/awx/ui/client/src/inventories/manage/adhoc/adhoc.route.js b/awx/ui/client/src/inventories/manage/adhoc/adhoc.route.js index 51625b17ea..05a8d6dcad 100644 --- a/awx/ui/client/src/inventories/manage/adhoc/adhoc.route.js +++ b/awx/ui/client/src/inventories/manage/adhoc/adhoc.route.js @@ -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") } }; diff --git a/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js b/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js index b93e5e1e0f..c80d9b0591 100644 --- a/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js +++ b/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js @@ -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', diff --git a/awx/ui/client/src/inventory-scripts/main.js b/awx/ui/client/src/inventory-scripts/main.js index fc979e0592..f9910640a2 100644 --- a/awx/ui/client/src/inventory-scripts/main.js +++ b/awx/ui/client/src/inventory-scripts/main.js @@ -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') } }) }); diff --git a/awx/ui/client/src/license/license.route.js b/awx/ui/client/src/license/license.route.js index 947820a6e1..78ab6e4348 100644 --- a/awx/ui/client/src/license/license.route.js +++ b/awx/ui/client/src/license/license.route.js @@ -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', diff --git a/awx/ui/client/src/lists/Schedules.js b/awx/ui/client/src/lists/Schedules.js index fbf03f5678..343f3c472d 100644 --- a/awx/ui/client/src/lists/Schedules.js +++ b/awx/ui/client/src/lists/Schedules.js @@ -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: '+ ADD', + buttonContent: '+ ' + 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' } } - }); + };}]); diff --git a/awx/ui/client/src/lists/Streams.js b/awx/ui/client/src/lists/Streams.js index 34e0652885..9604a89302 100644 --- a/awx/ui/client/src/lists/Streams.js +++ b/awx/ui/client/src/lists/Streams.js @@ -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
{{streamSubTitle}}', + editTitle: i18n._('Activity Stream'), + listTitle: 'Activity Stream
{{streamSubTitle}}', 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' } } - }); + };}]); diff --git a/awx/ui/client/src/login/loginModal/loginModal.partial.html b/awx/ui/client/src/login/loginModal/loginModal.partial.html index d6e30a20a3..eb124adcf4 100644 --- a/awx/ui/client/src/login/loginModal/loginModal.partial.html +++ b/awx/ui/client/src/login/loginModal/loginModal.partial.html @@ -86,7 +86,7 @@ -
NOTICE
{{ customLoginInfo | sanitize }}
+
NOTICE
{{ customLoginInfo | sanitize }}
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') } }) }); diff --git a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html index df0d5233c6..a8a6cbbb81 100644 --- a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html +++ b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html @@ -5,7 +5,7 @@
-
{{ $parent.organization_name }}
Add {{ addType | capitalize}} +
{{ $parent.organization_name }}
Add {{ addType | capitalize}}
diff --git a/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js b/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js index ceb8a45251..517e37c8c0 100644 --- a/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js +++ b/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js @@ -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) { diff --git a/awx/ui/client/src/organizations/main.js b/awx/ui/client/src/organizations/main.js index fac6a179e9..076c89d1aa 100644 --- a/awx/ui/client/src/organizations/main.js +++ b/awx/ui/client/src/organizations/main.js @@ -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) => { diff --git a/awx/ui/client/src/portal-mode/portal-mode.route.js b/awx/ui/client/src/portal-mode/portal-mode.route.js index 403ace5795..4ae8d287af 100644 --- a/awx/ui/client/src/portal-mode/portal-mode.route.js +++ b/awx/ui/client/src/portal-mode/portal-mode.route.js @@ -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: { diff --git a/awx/ui/client/src/scheduler/main.js b/awx/ui/client/src/scheduler/main.js index 9e04feae66..d1c44f6e09 100644 --- a/awx/ui/client/src/scheduler/main.js +++ b/awx/ui/client/src/scheduler/main.js @@ -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}
Schedules`; + SchedulesList.listTitle = `${ParentObject.name}
` + 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}
Schedules`; + SchedulesList.listTitle = `${ParentObject.name}
` + 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}
Schedules`; + SchedulesList.listTitle = `${ParentObject.name}
` + 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){ diff --git a/awx/ui/client/src/setup-menu/setup.route.js b/awx/ui/client/src/setup-menu/setup.route.js index aac58a64cb..4268f38087 100644 --- a/awx/ui/client/src/setup-menu/setup.route.js +++ b/awx/ui/client/src/setup-menu/setup.route.js @@ -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){ diff --git a/awx/ui/client/src/shared/paginate/paginate.partial.html b/awx/ui/client/src/shared/paginate/paginate.partial.html index cb085c45ec..e2249ae7b0 100644 --- a/awx/ui/client/src/shared/paginate/paginate.partial.html +++ b/awx/ui/client/src/shared/paginate/paginate.partial.html @@ -30,15 +30,15 @@ - Page + Page {{current()}} of {{last()}}
- ITEMS  + ITEMS  {{dataRange}} - of {{dataCount()}} + of {{dataCount()}}
diff --git a/awx/ui/client/src/shared/smart-search/smart-search.controller.js b/awx/ui/client/src/shared/smart-search/smart-search.controller.js index 6644943f0a..5d60842674 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.controller.js +++ b/awx/ui/client/src/shared/smart-search/smart-search.controller.js @@ -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 diff --git a/awx/ui/client/src/shared/smart-search/smart-search.partial.html b/awx/ui/client/src/shared/smart-search/smart-search.partial.html index 378d277391..b19b011698 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.partial.html +++ b/awx/ui/client/src/shared/smart-search/smart-search.partial.html @@ -4,14 +4,14 @@
-
-
+
Key
@@ -28,7 +28,7 @@ {{tag}}
- CLEAR ALL + CLEAR ALL
@@ -37,7 +37,7 @@
- EXAMPLES: + EXAMPLES:
@@ -45,13 +45,13 @@
- FIELDS: {{ key }}, + FIELDS: {{ key }},
- RELATED FIELDS: {{ relation }}, + RELATED FIELDS: {{ relation }},
- ADDITIONAL INFORMATION: For additional information on advanced search search syntax please see the Ansible Tower documentation. + ADDITIONAL INFORMATION: For additional information on advanced search search syntax please see the Ansible Tower documentation.
diff --git a/awx/ui/client/src/shared/stateDefinitions.factory.js b/awx/ui/client/src/shared/stateDefinitions.factory.js index 8279173dc9..16b317f32f 100644 --- a/awx/ui/client/src/shared/stateDefinitions.factory.js +++ b/awx/ui/client/src/shared/stateDefinitions.factory.js @@ -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 = []; diff --git a/awx/ui/client/src/system-tracking/system-tracking.route.js b/awx/ui/client/src/system-tracking/system-tracking.route.js index 6875df68fa..da803afc91 100644 --- a/awx/ui/client/src/system-tracking/system-tracking.route.js +++ b/awx/ui/client/src/system-tracking/system-tracking.route.js @@ -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: diff --git a/awx/ui/client/src/templates/list/templates-list.route.js b/awx/ui/client/src/templates/list/templates-list.route.js index e615e52db1..6846620d17 100644 --- a/awx/ui/client/src/templates/list/templates-list.route.js +++ b/awx/ui/client/src/templates/list/templates-list.route.js @@ -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,