From 0cadc20fea45c4db493c146af2d91ad95d754b61 Mon Sep 17 00:00:00 2001 From: Ira Hopkinson Date: Thu, 31 May 2018 13:23:27 +1200 Subject: [PATCH] Remove 'angular-translate' dependency - remove 'pascalprecht.translate' module references - remove use of $translateProvider - remove use of translate attribute and filter --- package-lock.json | 25 ------------------ package.json | 3 --- .../editor/document-set-move.modal.html | 6 ++--- .../editor/document-set-update.modal.html | 8 +++--- .../translate/editor/editor.component.html | 8 +++--- .../apps/translate/new-project/lang/en.json | 1 - .../translate-new-project.controller.ts | 20 +++++++------- .../translate-new-project.module.ts | 15 ++--------- .../views/new-project-abstract.html | 6 ++--- .../views/new-project-languages.html | 2 +- .../new-project/views/new-project-name.html | 4 +-- .../views/new-project-sr-clone.html | 4 +-- .../views/new-project-sr-credentials.html | 8 +++--- .../shared/languages-picker.component.html | 24 ++++++++--------- .../translate/translate-app.component.html | 3 +-- .../apps/translate/translate-app.module.ts | 26 +++---------------- .../userprofile/user-profile-app.module.ts | 17 +++++------- src/angular-app/bellows/lang/en.json | 0 src/angular-app/bellows/main.common.ts | 2 -- .../semdomtrans/semdomtrans.html | 2 +- .../sfchecks/partials/project.html | 2 +- .../sfchecks/partials/projectSettings.html | 2 +- .../sfchecks/partials/projectSettings.js | 11 +------- 23 files changed, 61 insertions(+), 138 deletions(-) delete mode 100644 src/angular-app/bellows/apps/translate/new-project/lang/en.json delete mode 100644 src/angular-app/bellows/lang/en.json diff --git a/package-lock.json b/package-lock.json index 13d325b054..c4ad2095a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,15 +47,6 @@ "@types/angular": "1.6.28" } }, - "@types/angular-translate": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@types/angular-translate/-/angular-translate-2.15.2.tgz", - "integrity": "sha512-5cVhOsi7s895Z2MkX0hXZaZLNAp4V0nMzk8/O45LX6DQkRCpyMw6zz6ErU1mb1AaWx1sJp2gInWa9tasx2/3eg==", - "dev": true, - "requires": { - "@types/angular": "1.6.28" - } - }, "@types/angular-ui-bootstrap": { "version": "0.13.46", "resolved": "https://registry.npmjs.org/@types/angular-ui-bootstrap/-/angular-ui-bootstrap-0.13.46.tgz", @@ -386,22 +377,6 @@ "resolved": "https://registry.npmjs.org/angular-sortable-view/-/angular-sortable-view-0.0.15.tgz", "integrity": "sha1-6EY9+Qnbg9ZBsCjwdzoQ1QKSh08=" }, - "angular-translate": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/angular-translate/-/angular-translate-2.17.0.tgz", - "integrity": "sha512-SudfI0R0Hhtvngc0X3wFChXQGmw90o95i+QPZ11LhJJryneTq8LR3+3E4E7jgHA4fu6TcswgcfZ9+cp5ckbUHw==", - "requires": { - "angular": "1.6.10" - } - }, - "angular-translate-loader-static-files": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/angular-translate-loader-static-files/-/angular-translate-loader-static-files-2.17.0.tgz", - "integrity": "sha512-5mZ8pYlqNeV+8FW01r4DzV3/t930MrgLXSTRKfCzPLjbUQSpcSKwMhjc6QbaHHminevD4FyO2ZyilGCsw3yiKA==", - "requires": { - "angular-translate": "2.17.0" - } - }, "angular-ui-bootstrap-4": { "version": "git+https://github.com/sillsdev/bootstrap.git#39f2852984db6970ef67f173ad09b23d83f21ec7" }, diff --git a/package.json b/package.json index 320150c220..07fae5b68e 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,6 @@ "angular-route": "^1.6.5", "angular-sanitize": "^1.6.10", "angular-sortable-view": "0.0.15", - "angular-translate": "^2.15.2", - "angular-translate-loader-static-files": "^2.15.2", "angular-ui-bootstrap-4": "git+https://github.com/sillsdev/bootstrap.git", "angular-ui-router": "0.4.2", "angular-ui-validate": "^1.2.3", @@ -53,7 +51,6 @@ "@types/angular-mocks": "^1.5.10", "@types/angular-route": "^1.3.4", "@types/angular-sanitize": "^1.3.5", - "@types/angular-translate": "^2.15.1", "@types/angular-ui-bootstrap": "^0.13.44", "@types/angular-ui-router": "^1.1.37", "@types/bootstrap": "^3.3.35", diff --git a/src/angular-app/bellows/apps/translate/editor/document-set-move.modal.html b/src/angular-app/bellows/apps/translate/editor/document-set-move.modal.html index a1f1a264ca..27827f6cbb 100644 --- a/src/angular-app/bellows/apps/translate/editor/document-set-move.modal.html +++ b/src/angular-app/bellows/apps/translate/editor/document-set-move.modal.html @@ -1,16 +1,16 @@
diff --git a/src/angular-app/bellows/apps/translate/editor/document-set-update.modal.html b/src/angular-app/bellows/apps/translate/editor/document-set-update.modal.html index dadf372123..1de83acf17 100644 --- a/src/angular-app/bellows/apps/translate/editor/document-set-update.modal.html +++ b/src/angular-app/bellows/apps/translate/editor/document-set-update.modal.html @@ -1,18 +1,18 @@
diff --git a/src/angular-app/bellows/apps/translate/editor/editor.component.html b/src/angular-app/bellows/apps/translate/editor/editor.component.html index a1dbb0a766..d99cb9476e 100644 --- a/src/angular-app/bellows/apps/translate/editor/editor.component.html +++ b/src/angular-app/bellows/apps/translate/editor/editor.component.html @@ -95,7 +95,7 @@
- + @@ -109,13 +109,13 @@
{ @@ -185,8 +185,8 @@ export class TranslateNewProjectController implements angular.IController { this.isSRProject = true; this.show.nextButton = true; this.show.backButton = true; - this.nextButtonLabel = this.$filter('translate')('Next'); - this.progressIndicatorStep2Label = this.$filter('translate')('Connect'); + this.nextButtonLabel = 'Next'; + this.progressIndicatorStep2Label = 'Connect'; this.resetValidateProjectForm(); } @@ -195,8 +195,8 @@ export class TranslateNewProjectController implements angular.IController { this.isSRProject = false; this.show.nextButton = true; this.show.backButton = true; - this.nextButtonLabel = this.$filter('translate')('Next'); - this.progressIndicatorStep2Label = this.$filter('translate')('Languages'); + this.nextButtonLabel = 'Next'; + this.progressIndicatorStep2Label = 'Languages'; } iconForStep(step: number) { @@ -219,7 +219,7 @@ export class TranslateNewProjectController implements angular.IController { switch (this.$state.current.name) { case 'newProject.sendReceiveCredentials': this.$state.go('newProject.name'); - this.nextButtonLabel = this.$filter('translate')('Next'); + this.nextButtonLabel = 'Next'; break; case 'newProject.name': this.$state.go('newProject.chooser'); @@ -349,7 +349,7 @@ export class TranslateNewProjectController implements angular.IController { this.projectCodeState = 'empty'; this.projectCodeStateDefer = this.$q.defer(); this.projectCodeStateDefer.resolve('empty'); - this.nextButtonLabel = this.$filter('translate')(this.isSRProject ? 'Get Started' : 'Next'); + this.nextButtonLabel = this.isSRProject ? 'Get Started' : 'Next'; this.makeFormNeutral(); if (this.isSRProject) { this.getParatextUserInfo(); diff --git a/src/angular-app/bellows/apps/translate/new-project/translate-new-project.module.ts b/src/angular-app/bellows/apps/translate/new-project/translate-new-project.module.ts index e1dfb5e44b..f1da6bae3d 100644 --- a/src/angular-app/bellows/apps/translate/new-project/translate-new-project.module.ts +++ b/src/angular-app/bellows/apps/translate/new-project/translate-new-project.module.ts @@ -11,7 +11,6 @@ import {TranslateNewProjectController} from './translate-new-project.controller' export const TranslateNewProjectModule = angular.module('translate-new-project', [ 'ui.bootstrap', uiRouter, - 'pascalprecht.translate', 'ngFileUpload', CoreModule, PuiUtilityModule, @@ -20,18 +19,8 @@ export const TranslateNewProjectModule = angular.module('translate-new-project', TranslateSharedModule ]) .controller('NewTranslateProjectCtrl', TranslateNewProjectController) - .config(['$stateProvider', '$urlRouterProvider', '$translateProvider', - ($stateProvider: angular.ui.IStateProvider, - $urlRouterProvider: angular.ui.IUrlRouterProvider, - $translateProvider: angular.translate.ITranslateProvider) => { - - // configure interface language filepath - $translateProvider.useStaticFilesLoader({ - prefix: '/angular-app/bellows/apps/translate/new-project/lang/', - suffix: '.json' - }); - $translateProvider.preferredLanguage('en'); - $translateProvider.useSanitizeValueStrategy('escape'); + .config(['$stateProvider', '$urlRouterProvider', + ($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider) => { // State machine from ui.router $stateProvider diff --git a/src/angular-app/bellows/apps/translate/new-project/views/new-project-abstract.html b/src/angular-app/bellows/apps/translate/new-project/views/new-project-abstract.html index 46d49d9626..2380c24712 100644 --- a/src/angular-app/bellows/apps/translate/new-project/views/new-project-abstract.html +++ b/src/angular-app/bellows/apps/translate/new-project/views/new-project-abstract.html @@ -3,7 +3,7 @@
-

+

Start or join a Translation Project

    @@ -28,7 +28,7 @@

    -
    {{$ctrl.formStatus | translate}} 
    +
    {{$ctrl.formStatus}} 
    @@ -40,7 +40,7 @@

    - {{'Back' | translate}} + Back
diff --git a/src/angular-app/scriptureforge/sfchecks/partials/projectSettings.html b/src/angular-app/scriptureforge/sfchecks/partials/projectSettings.html index e477ee0c24..1d1977f158 100644 --- a/src/angular-app/scriptureforge/sfchecks/partials/projectSettings.html +++ b/src/angular-app/scriptureforge/sfchecks/partials/projectSettings.html @@ -197,7 +197,7 @@

{{project.projectName}} Settings