diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 297aac13..db29558c 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -1357,6 +1357,12 @@ "CANCEL": "Cancel" }, "JOYRIDE": { + "NAV": { + "NEXT": "Next", + "BACK": "Back", + "SKIP": "Skip", + "DONE": "Done" + }, "DASHBOARD": { "STEP1": { "TITLE": "Your project", diff --git a/app/modules/components/joy-ride/joy-ride.directive.coffee b/app/modules/components/joy-ride/joy-ride.directive.coffee index 8b482811..82269f5e 100644 --- a/app/modules/components/joy-ride/joy-ride.directive.coffee +++ b/app/modules/components/joy-ride/joy-ride.directive.coffee @@ -19,23 +19,11 @@ taiga = @.taiga -JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) -> +JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location, $translate) -> link = (scope, el, attrs, ctrl) -> unsuscribe = null intro = introJs() - #Todo: translate - intro.setOptions({ - exitOnEsc: false, - exitOnOverlayClick: false, - showStepNumbers: false, - nextLabel: 'Next →', - prevLabel: '← Back', - skipLabel: 'Skip', - doneLabel: 'Done', - disableInteraction: true - }) - intro.oncomplete () -> $('html,body').scrollTop(0) @@ -46,6 +34,17 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) - if !config[next.joyride] return + intro.setOptions({ + exitOnEsc: false, + exitOnOverlayClick: false, + showStepNumbers: false, + nextLabel: $translate.instant('JOYRIDE.NAV.NEXT') + ' →', + prevLabel: '← ' + $translate.instant('JOYRIDE.NAV.BACK'), + skipLabel: $translate.instant('JOYRIDE.NAV.SKIP'), + doneLabel: $translate.instant('JOYRIDE.NAV.DONE'), + disableInteraction: true + }) + intro.setOption('steps', joyRideService.get(next.joyride)) intro.start() @@ -78,7 +77,8 @@ JoyRideDirective.$inject = [ "$rootScope", "tgCurrentUserService", "tgJoyRideService", - "$location" + "$location", + "$translate" ] angular.module("taigaComponents").directive("tgJoyRide", JoyRideDirective)