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