Skip to content

Commit

Permalink
Merge pull request sillsdev#273 from sillsdev/refactor/removeLocalisa…
Browse files Browse the repository at this point in the history
…tionDep

Remove 'angular-translate' dependency
  • Loading branch information
irahopkinson authored May 31, 2018
2 parents 32d1b7d + 0cadc20 commit b54f2a3
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 138 deletions.
25 changes: 0 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<form name="docSetFieldForm" class="ng-pristine ng-valid ng-scope ng-submitted" data-ng-submit="move()">
<div class="modal-header">
<h3 data-translate="Move Document Set"></h3>
<h3>Move Document Set</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-form-label" for="positionSelect" data-translate="Position"></label>
<label class="col-form-label" for="positionSelect">Position</label>
<select class="custom-select" id="positionSelect" autofocus data-ng-model="newIndex"
data-ng-options="index as option for (index, option) in positionOptions"></select>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="submit">
<i class="fa fa-arrows-v"></i> {{'Move' | translate}} {{documentSet.name}}</button>
<i class="fa fa-arrows-v"></i> Move <span class="notranslate">{{documentSet.name}}</span></button>
</div>
</form>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<form name="docSetFieldForm" class="ng-pristine ng-valid ng-scope ng-submitted" data-ng-submit="update()">
<div class="modal-header">
<h3>{{titleLabel | translate}}</h3>
<h3 class="notranslate">{{titleLabel}}</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-form-label" for="name" data-translate="Display Name"></label>
<label class="col-form-label" for="name">Display Name</label>
<input class="form-control" id="name" autofocus
required type="text" name="name"
placeholder="{{'name' | translate}}"
placeholder="name"
data-ng-model="documentSet.name">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="submit">
<i class="fa fa-plus"></i> {{buttonLabel | translate}} {{documentSet.name}}</button>
<i class="fa fa-plus"></i> {{buttonLabel}} <span class="notranslate">{{documentSet.name}}</span></button>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<div id="editor-area" class="row flex-grow">
<div id="picklist-column" class="col-sm d-flex flex-column mb-1">
<div class="d-flex flex-no-grow">
<label class="editor-label flex-grow text-truncate" data-translate="Documents"></label>
<label class="editor-label flex-grow text-truncate">Documents</label>
<button type="button" class="btn btn-std btn-sm mb-1" data-ng-click="$ctrl.modalUpdateDocumentSet()"
data-ng-show="$ctrl.tecRights.canEditProject() && !$ctrl.isScripture">
<i class="fa fa-plus"></i></button>
Expand All @@ -109,13 +109,13 @@
<i class="fa fa-ellipsis-v"></i></a>
<div class="dropdown-menu" data-ng-class="$ctrl.dropdownMenuClass" uib-dropdown-menu aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" data-ng-click="$ctrl.modalUpdateDocumentSet($index)">
<i class="fa fa-pencil iconPadding"></i>{{'Edit Name' | translate}}</a>
<i class="fa fa-pencil iconPadding"></i>Edit Name</a>
<a class="dropdown-item" data-ng-click="$ctrl.modalMoveDocumentSet($index)">
<i class="fa fa-arrows-v iconPadding"></i>{{'Move' | translate}}</a>
<i class="fa fa-arrows-v iconPadding"></i>Move</a>
<div class="dropdown-divider" data-ng-show="!$ctrl.isScripture"></div>
<a class="dropdown-item" data-ng-click="$ctrl.modalDeleteDocumentSet($index)"
data-ng-show="!$ctrl.isScripture">
<i class="fa fa-times iconPadding"></i>{{'Delete' | translate}}</a>
<i class="fa fa-times iconPadding"></i>Delete</a>
</div>
</div>
<div class="picklistLabel" data-ng-click="$ctrl.selectDocumentSet($index)"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export class TranslateNewProjectController implements angular.IController {
this.show.flexHelp = false;
this.show.cloning = true;
this.show.step3 = true;
this.nextButtonLabel = this.$filter('translate')('Next');
this.progressIndicatorStep1Label = this.$filter('translate')('Name');
this.progressIndicatorStep2Label = this.$filter('translate')('Languages');
this.progressIndicatorStep3Label = this.$filter('translate')('Verify');
this.nextButtonLabel = 'Next';
this.progressIndicatorStep1Label = 'Name';
this.progressIndicatorStep2Label = 'Languages';
this.progressIndicatorStep3Label = 'Verify';
this.resetValidateProjectForm();

this.$scope.$watch(() => {
Expand Down Expand Up @@ -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();
}

Expand All @@ -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) {
Expand All @@ -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');
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="form-container">
<div class="text-center">

<h2 data-translate="Start or join a Translation Project"></h2>
<h2>Start or join a Translation Project</h2>
<div class="row justify-content-center" data-ng-show="$ctrl.show.nextButton">
<div class="col-md-10">
<ul class="list-inline" id="progress-indicator">
Expand All @@ -28,7 +28,7 @@ <h2 data-translate="Start or join a Translation Project"></h2>
<form class="form" id="newLexProjectForm" name="newLexProjectForm" data-ng-pristine data-ng-valid
data-ng-scope data-ng-submit="$ctrl.nextStep()">
<div class="row justify-content-center">
<div class="col-md-10" id="form-status" data-ng-class="$ctrl.formStatusClass">{{$ctrl.formStatus | translate}}&nbsp;</div>
<div class="col-md-10" id="form-status" data-ng-class="$ctrl.formStatusClass">{{$ctrl.formStatus}}&nbsp;</div>
</div>

<!-- our nested state views will be injected here -->
Expand All @@ -40,7 +40,7 @@ <h2 data-translate="Start or join a Translation Project"></h2>
<a class="btn btn-std" data-ng-class="$ctrl.interfaceConfig.pullNormal"
id="backButton" data-ng-click="$ctrl.prevStep()" data-ng-show="$ctrl.show.backButton">
<i class="fa fa-arrow-circle-left"></i>
{{'Back' | translate}}
Back
</a>

<button type="submit" class="btn btn-std" data-ng-class="[$ctrl.interfaceConfig.pullToSide, $ctrl.forwardBtnClass]" href="#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row justify-content-center">
<div class="col-md-10">
<div class="text-center">
<h3 class="no-space-break" data-translate="Enter the Project's Languages"></h3>
<h3 class="no-space-break">Enter the Project's Languages</h3>
</div>
<div class="card card-default">
<div class="card-body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="row justify-content-center">
<div class="col-md-10">
<div class="text-center">
<h3 class="no-space-break" data-translate="Choose a project name"></h3>
<h3 class="no-space-break">Choose a project name</h3>
</div>
<div class="card card-default">
<div class="card-body">
<div class="form-group row">
<label class="col-form-label col-md-4 text-md-right" data-translate="Project Name"></label>
<label class="col-form-label col-md-4 text-md-right">Project Name</label>
<div class="controls col-md-8">
<div class="input-group">
<input class="form-control"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<div class="card card-default text-center">
<div data-ng-show="$ctrl.show.cloning">
<div class="card-header">
<h3 data-translate="Please wait while the project is created..."></h3>
<h3>Please wait while the project is created...</h3>
</div>
<div class="card-body">
<i class="fa fa-spinner fa-spin fa-2x" id="cloning"></i>
<span>{{'Creating initial data. This may take a few minutes...' | translate}}</span>
<span>Creating initial data. This may take a few minutes...</span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row justify-content-center">
<div class="col-md-10">
<div class="text-center">
<h4 class ="no-space-break" data-translate="Get project from Paratext"></h4>
<h4 class ="no-space-break">Get project from Paratext</h4>
</div>
<div class="card card-default">
<div class="card-body">
Expand All @@ -17,14 +17,14 @@ <h4 class ="no-space-break" data-translate="Get project from Paratext"></h4>
</div>
<div data-ng-if="$ctrl.isSignedIntoParatext && !$ctrl.isRetrievingParatextUserInfo">
<div class="form-group row">
<label class="col-form-label col-md-4 text-md-right" data-translate="Signed in as"></label>
<label class="col-form-label col-md-4 text-md-right">Signed in as</label>
<label class="col-form-label col-md-8">
<span>{{ $ctrl.paratextUserInfo.username }}</span>
(<a href data-ng-click="$ctrl.signIntoParatext()">change user</a>)
</label>
</div>
<div class="form-group row">
<label class="col-form-label col-md-4 text-md-right" for="srSourceSelect" data-translate="Source"></label>
<label class="col-form-label col-md-4 text-md-right" for="srSourceSelect">Source</label>
<div class="input-group col-md-8">
<select class="form-control custom-select" id="srSourceSelect" required
data-ng-model="$ctrl.sourceParatextProject" data-ng-change="$ctrl.validateForm()"
Expand All @@ -33,7 +33,7 @@ <h4 class ="no-space-break" data-translate="Get project from Paratext"></h4>
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-4 text-md-right" for="srTargetSelect" data-translate="Target"></label>
<label class="col-form-label col-md-4 text-md-right" for="srTargetSelect">Target</label>
<div class="input-group col-md-8">
<select class="form-control custom-select" id="srTargetSelect" required
data-ng-model="$ctrl.targetParatextProject" data-ng-change="$ctrl.validateForm()"
Expand Down
Loading

0 comments on commit b54f2a3

Please sign in to comment.