diff --git a/Frontend Angular 4/.angular-cli.json b/Frontend Angular 4/.angular-cli.json index 530ff8d1ff73419bdd22e1733ac450113e273376..de7f7a5b17131219209207183a7bc5682d715967 100644 --- a/Frontend Angular 4/.angular-cli.json +++ b/Frontend Angular 4/.angular-cli.json @@ -21,6 +21,7 @@ "prefix": "app", "styles": [ "../node_modules/font-awesome/css/font-awesome.css", + "../node_modules/flag-icon-css/css/flag-icon.min.css", "styles/app.scss", "styles/console.css", "styles/hints.css", diff --git a/Frontend Angular 4/package-lock.json b/Frontend Angular 4/package-lock.json index 3b36451aba24ccf4db92e203a1a143df273c5f47..0339d889118f1e7972554025ad4173a9d09262cc 100644 --- a/Frontend Angular 4/package-lock.json +++ b/Frontend Angular 4/package-lock.json @@ -1,6 +1,6 @@ { "name": "matefun", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3490,6 +3490,11 @@ } } }, + "flag-icon-css": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/flag-icon-css/-/flag-icon-css-3.2.1.tgz", + "integrity": "sha512-0t7zPm2crM2cBIm3epZQ+EmiHuzgFNTTSMUMkWlrztDDGL+y31D+eY8zaB9zYCzJGAsn4KEMAKY+jCU1mt9jwg==" + }, "flatten": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", diff --git a/Frontend Angular 4/package.json b/Frontend Angular 4/package.json index 33c5175c061dc126f7bd3fbb91e84c9d7747e1c0..b2605e1907836c13de998db98667cc4055a38580 100755 --- a/Frontend Angular 4/package.json +++ b/Frontend Angular 4/package.json @@ -25,6 +25,7 @@ "@ngx-translate/http-loader": "^0.1.0", "core-js": "^2.4.1", "d3": "^4.12.2", + "flag-icon-css": "^3.2.1", "font-awesome": "^4.7.0", "function-plot": "git://github.com/diego-rey/function-plot.git#feature/integration-multigraf-shape", "graph3D": "git://github.com/ifagian/graph3D#master", diff --git a/Frontend Angular 4/src/app/app.component.html b/Frontend Angular 4/src/app/app.component.html index eb9fe87ff82870fce7a7979e83abb3d5fece5e19..0680b43f9c6ae05df91c576141f20ed411d07c7d 100755 --- a/Frontend Angular 4/src/app/app.component.html +++ b/Frontend Angular 4/src/app/app.component.html @@ -1,4 +1 @@ -<div> - <router-outlet></router-outlet> - <span class="translate">{{ "HELLO" | translate }}</span> -</div> +<router-outlet></router-outlet> diff --git a/Frontend Angular 4/src/app/app.component.ts b/Frontend Angular 4/src/app/app.component.ts index a1f2a8d420289859c922c72141a59c22b82b2082..4f1d4c099393608645c07f149422f474390c2c69 100755 --- a/Frontend Angular 4/src/app/app.component.ts +++ b/Frontend Angular 4/src/app/app.component.ts @@ -10,8 +10,13 @@ import { TranslateService } from '../../node_modules/@ngx-translate/core'; export class AppComponent implements OnInit { constructor(public router: Router, public translate: TranslateService) { this.translate.addLangs(['es', 'en']); - this.translate.setDefaultLang('es'); - //this.translate.use('en'); + let currentSession = sessionStorage.getItem("currentUser"); + let language = currentSession ? JSON.parse(currentSession).language : 'es'; + if (language) { + this.translate.setDefaultLang(language); + } else { + this.translate.setDefaultLang('es'); + } } ngOnInit() { //this.router.navigate(['/login']); diff --git a/Frontend Angular 4/src/app/layout/archivos/archivos.component.html b/Frontend Angular 4/src/app/layout/archivos/archivos.component.html index 6df5a10f81854ae0c8b10b5f89db033375702fca..0b99729c18ba1e81d76ce9eb48d1b4cc31520eb4 100755 --- a/Frontend Angular 4/src/app/layout/archivos/archivos.component.html +++ b/Frontend Angular 4/src/app/layout/archivos/archivos.component.html @@ -2,7 +2,7 @@ <div class="container-fluid"> <div class="row"> <div class="col-lg-5"> - <label for="search">Nombre del archivo:</label> + <label for="search">{{ "i18n.msg.file.fileName" | translate }}:</label> <div class="input-group"> <input type="text" class="form-control" id="search" [(ngModel)]=filtroNombre> <span class="input-group-addon fa fa-search"> @@ -15,42 +15,66 @@ <div class="row" style="margin-top: 20px"> <div class="col-lg-5"> <ngb-tabset [destroyOnHide]=false> - <ngb-tab title="Mis archivos"> + <ngb-tab title='{{ "i18n.msg.file.myFiles" | translate }}'> <ng-template ngbTabContent> <div class="card"> <div> <div class="btn-group pull-right" style="cursor: pointer; margin-top: -9px;"> - <button ngbPopover="Atras" triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary pull-right" *ngIf="directorioActual.padreId!=-1" style="cursor: pointer; margin-top: -33.5px; margin-right: 73px; height: 30px;"(click)="navBack()"> + <button ngbPopover='{{ "i18n.action.goBack" | translate | titleCase }}' triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary pull-right" *ngIf="directorioActual.padreId!=-1" style="cursor: pointer; margin-top: -33.5px; margin-right: 73px; height: 30px;"(click)="navBack()"> <i class="fa fa-arrow-up"></i> </button> </div> <!-- <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px;" > <i class="fa fa-plus"></i> </buton> --> - <div class="btn-group pull-right" style="cursor: pointer; margin-top: -42px; height: 30px; width: 29px;"> - <button ngbPopover="Nuevo" triggers="mouseenter:mouseleave" data-placement="bottom" style="cursor: pointer;border-radius: 3px;" type="button" class="btn btn-sm btn-secondary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <div class="btn-group pull-right" style="cursor: pointer; margin-top: -42px; height: 30px; width: 29px;"> + <button + ngbPopover='{{ "i18n.action.new" | translate | titleCase }}' + triggers="mouseenter:mouseleave" + data-placement="bottom" + style="cursor: pointer;border-radius: 3px;" + type="button" + class="btn btn-sm btn-secondary" + data-toggle="dropdown" + aria-haspopup="true" + aria-expanded="false"> <i class="fa fa-plus"></i> </button> <div class="dropdown-menu"> - <a class="dropdown-item"(click)="mkFile()" >Archivo</a> + <a class="dropdown-item"(click)="mkFile()"> + {{ "i18n.object.file" | translate | titleCase }} + </a> <div class="dropdown-divider"></div> - <a class="dropdown-item" (click)="mkdir()">Carpeta</a> + <a class="dropdown-item" (click)="mkdir()"> + {{ "i18n.object.folder" | translate | titleCase }} + </a> </div> </div> - <div class="btn-group pull-right" style="cursor: pointer; margin-top: -42px; height: 30px; width: 29px; margin-right: 36px;"> - <button ngbPopover="Ordenar" triggers="mouseenter:mouseleave" data-placement="bottom" style="cursor: pointer;border-radius: 3px;width: 36px;" type="button" class="btn btn-sm btn-secondary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <div class="btn-group pull-right" style="cursor: pointer; margin-top: -42px; height: 30px; width: 29px; margin-right: 36px;"> + <button + ngbPopover='{{ "i18n.action.order" | translate | titleCase }}' + triggers="mouseenter:mouseleave" + data-placement="bottom" + style="cursor: pointer;border-radius: 3px;width: 36px;" + type="button" + class="btn btn-sm btn-secondary" + data-toggle="dropdown" + aria-haspopup="true" + aria-expanded="false"> <i class="fa fa-sort"></i> </button> <div class="dropdown-menu"> - <a class="dropdown-item"(click)="ordenarPorTipo()" >Carpetas primero</a> + <a class="dropdown-item"(click)="ordenarPorTipo()"> + {{ "i18n.msg.order.kind" | translate }} + </a> <div class="dropdown-divider"></div> - <a class="dropdown-item" (click)="ordenarPorFecha()">Fecha de creación</a> + <a class="dropdown-item" (click)="ordenarPorFecha()"> + {{ "i18n.msg.order.date" | translate }} + </a> </div> </div> - - </div> <div class="card-block"> <div class="row listado-archivos" style="min-height: 100px; overflow-y: scroll;"> @@ -71,7 +95,7 @@ </ng-template> </ngb-tab> - <ngb-tab title="Compartidos"> + <ngb-tab title='{{ "i18n.action.shared" | translate | titleCase }}'> <ng-template ngbTabContent> <div class="card" *ngIf="esAlumno"> @@ -98,38 +122,79 @@ <div class="col-lg-7"> <div class="card"> <div class="card-header"> - <button ngbPopover="Cargar/Editar" data-placement="bottom" triggers="mouseenter:mouseleave" class="btn btn-sm btn-secondary pull-left mr-2" (click)="cargarArchivo()"> + <button + ngbPopover='{{ "i18n.action.load" | translate | titleCase }}/{{ "i18n.action.edit" | translate | titleCase }}' + data-placement="bottom" + triggers="mouseenter:mouseleave" + class="btn btn-sm btn-secondary pull-left mr-2" + (click)="cargarArchivo()"> <i class="fa fa-pencil"></i> </button> - <button ngbPopover="Eliminar" data-placement="bottom" triggers="mouseenter:mouseleave" class="btn btn-sm btn-secondary pull-left mr-2" (click)="mostrarEliminarDialogo()"> + <button + ngbPopover='{{ "i18n.action.delete" | translate | titleCase }}' + data-placement="bottom" + triggers="mouseenter:mouseleave" + class="btn btn-sm btn-secondary pull-left mr-2" + (click)="mostrarEliminarDialogo()"> <i class="fa fa-remove"></i> </button> - <button ngbPopover="Mover Archivo"data-placement="bottom" triggers="mouseenter:mouseleave" class="btn btn-sm btn-secondary pull-left mr-2" (click)="seleccionarDirectorioAMover()"> + <button + ngbPopover='{{ "i18n.action.move" | translate | titleCase }} {{ "i18n.object.file" | translate | titleCase }}' + data-placement="bottom" + triggers="mouseenter:mouseleave" + class="btn btn-sm btn-secondary pull-left mr-2" + (click)="seleccionarDirectorioAMover()"> <i class="fa fa-cut"></i> </button> - - <button class="btn btn-sm btn-secondary pull-left mr-2" *ngIf="esAlumno && archivoSeleccionado && hayArchivoOriginal()" (click)="seleccionarArchivoOriginal()">Ver original</button> - - <button class="btn btn-sm btn-secondary pull-left mr-2" *ngIf="esAlumno && archivoSeleccionado && hayArchivoMio()" (click)="seleccionarArchivoMio()">Ver mio</button> - - <button class="btn btn-sm btn-secondary pull-left mr-4" *ngIf="esAlumno && archivoSeleccionado && !archivoSeleccionado.directorio && archivoSeleccionado.archivoOrigenId != -1 && (archivoSeleccionado.estado == 'Edicion' || archivoSeleccionado.estado == 'Devuelto')" (click)="confirmarEntrega()">Entregar</button> + <button + class="btn btn-sm btn-secondary pull-left mr-2" + *ngIf="esAlumno && archivoSeleccionado && hayArchivoOriginal()" + (click)="seleccionarArchivoOriginal()"> + {{ "i18n.msg.file.seeOriginal" | translate }} + </button> + <button + class="btn btn-sm btn-secondary pull-left mr-2" + *ngIf="esAlumno && archivoSeleccionado && hayArchivoMio()" + (click)="seleccionarArchivoMio()"> + {{ "i18n.msg.file.seeMine" | translate }} + </button> + <button + class="btn btn-sm btn-secondary pull-left mr-4" + *ngIf="esAlumno && archivoSeleccionado && !archivoSeleccionado.directorio && archivoSeleccionado.archivoOrigenId != -1 && (archivoSeleccionado.estado == 'Edicion' || archivoSeleccionado.estado == 'Devuelto')" + (click)="confirmarEntrega()"> + {{ "i18n.action.send" | translate }} + </button> - <div class="pull-left mr-2" *ngIf="esAlumno && (archivoSeleccionado?.estado == 'Entregado')">{{archivoSeleccionado.estado}} - </div> - - <button *ngIf="esAlumno && archivoSeleccionado?.estado == 'Corregido'" class="btn btn-sm btn-secondary pull-left mr-2" (click)="verCalificacion()">Ver calificacion</button> + <div + class="pull-left mr-2" + *ngIf="esAlumno && (archivoSeleccionado?.estado == 'Entregado')"> + {{archivoSeleccionado.estado}} - </div> + + <button + *ngIf="esAlumno && archivoSeleccionado?.estado == 'Corregido'" + class="btn btn-sm btn-secondary pull-left mr-2" + (click)="verCalificacion()"> + {{ "i18n.msg.file.viewCalification" | translate }} + </button> - <button *ngIf="!esAlumno" class="btn btn-sm btn-secondary pull-left mr-2" (click)="compartirArchivo()">Compartir</button> + <button *ngIf="!esAlumno" class="btn btn-sm btn-secondary pull-left mr-2" (click)="compartirArchivo()"> + {{ "i18n.action.share" | translate | titleCase }} + </button> <div class="pull-left" *ngIf="archivoSeleccionado"> - Nombre: {{archivoSeleccionado?.nombre}} - Creado: {{archivoSeleccionado?.fechaCreacion | date}} + {{ "i18n.object.name" | translate | titleCase }}: + {{archivoSeleccionado?.nombre}} + - + {{ "i18n.action.created" | translate | titleCase }}: + {{archivoSeleccionado?.fechaCreacion | date}} </div> - <div class="pull-left" *ngIf="!archivoSeleccionado">Seleccione un archivo para previsualizarlo</div> + <div class="pull-left" *ngIf="!archivoSeleccionado">{{ "i18n.msg.file.preview" | translate }}</div> <div class="pull-right" *ngIf="archivoSeleccionado"> <label class="custom-control custom-checkbox" *ngIf="!esAlumno"> <input type="checkbox" *ngIf="archivoSeleccionado.editable" (click)="setSoloLectura()" class="custom-control-input"> <input type="checkbox" *ngIf="!archivoSeleccionado.editable" checked (click)="setSoloLectura()" class="custom-control-input"> <span class="custom-control-indicator"></span> - <span class="custom-control-description">Solo lectura</span> + <span class="custom-control-description">{{ "i18n.msg.file.readOnly" | translate }}</span> </label> </div> </div> @@ -138,8 +203,13 @@ <i style="color: rgb(220,220,220); font-size: 10em; padding: 0.1em" class="fa fa-file-text"></i> </div> </div> - <codemirror class="codemirrorArchivo" *ngIf="archivoSeleccionado" [(ngModel)]="preview" [config]="configCodeMirror" [ngStyle]="{'font-size': configCodeMirror.fontSize+'px'}"> - </codemirror> + <codemirror + class="codemirrorArchivo" + *ngIf="archivoSeleccionado" + [(ngModel)]="preview" + [config]="configCodeMirror" + [ngStyle]="{'font-size': configCodeMirror.fontSize+'px'}"> + </codemirror> </div> </div> diff --git a/Frontend Angular 4/src/app/layout/archivos/archivos.component.ts b/Frontend Angular 4/src/app/layout/archivos/archivos.component.ts index 09ceca704024f9f7ef76acbde016818648a8df64..f0418ad543c4971e936584707039f2de3845184e 100755 --- a/Frontend Angular 4/src/app/layout/archivos/archivos.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/archivos.component.ts @@ -14,6 +14,8 @@ import { ConfirmComponent } from '../../shared/modal/confirm.component'; import { SeleccionarDirectorioMove } from './seleccionarDirectorio.component'; import { CodemirrorComponent } from 'ng2-codemirror'; import { NgbPopoverConfig, NgbPopover} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService } from '@ngx-translate/core'; +import { TitleCasePipe } from '../../shared/pipes/titlecase.pipe'; import 'codemirror/mode/haskell/haskell'; import 'codemirror/addon/display/panel'; @@ -28,6 +30,8 @@ import 'codemirror/mode/markdown/markdown'; }) export class ArchivosComponent { + translateService : any; + titlecasePipe: any; archivos : Archivo[] = []; archivosCompartidos: Archivo[] = []; archivosCompartidosSinDuplicados: Archivo [] = []; @@ -49,8 +53,12 @@ export class ArchivosComponent { private authService: AuthenticationService, private haskellService: HaskellService, private sessionService: SessionService, - private dialogService:DialogService + private dialogService:DialogService, + public translate: TranslateService ){ + this.translateService = translate; + this.titlecasePipe = new TitleCasePipe(); + this.esAlumno = JSON.parse(sessionStorage.getItem("currentUser")).tipo ==="alumno"; this.directorioActual = {}; this.directorioActual.archivos = []; @@ -182,23 +190,21 @@ export class ArchivosComponent { if(this.archivos.some(arch => arch.id == this.archivoSeleccionado.id)){ var that = this; let disposable = this.dialogService.addDialog(ConfirmarEliminar, { - nombreArchivo:that.archivoSeleccionado.nombre, - esDirectorio:that.archivoSeleccionado.directorio, - parentContext :that}) + nombreArchivo : {fileName: that.archivoSeleccionado.nombre}, + esDirectorio : that.archivoSeleccionado.directorio, + parentContext : that}) .subscribe((isConfirmed)=>{ - if(isConfirmed) { - - //codeMirrorRef.options.readOnly = false; //componentRef.editDialogFired = true; } }); + console.log(disposable); }else{ - this.notifService.warning("Sin permisos para eliminar el archivo"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noPermissionRemove').value); } }else{ - this.notifService.warning("Archivo no seleccionado"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value); } } seleccionarDirectorioAMover(){ @@ -221,10 +227,10 @@ export class ArchivosComponent { } }); }else{ - this.notifService.warning("Sin permisos para mover el archivo"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noPermissionMove').value); } }else{ - this.notifService.warning("Archivo no seleccionado"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value); } } @@ -259,7 +265,7 @@ export class ArchivosComponent { this.haskellService.editarArchivo(this.archivoSeleccionado.id,this.archivoSeleccionado) .subscribe( archivo => { - console.log("Archivo modificado"); + console.log(this.translateService.get('i18n.msg.file.modified').value); }, error => { @@ -271,7 +277,7 @@ export class ArchivosComponent { cargarArchivo(){ if(this.archivoSeleccionado){ if(this.archivoSeleccionado.directorio){ - this.notifService.warning('No se seleccionó ningún archivo',false); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value, false); }else{ //Si el archivo es compartido con el grupo, editabe y no lo he editado, lo voy a buscar al servidor. if(this.archivosCompartidos.some(arch => arch.id == this.archivoSeleccionado.id) && this.archivoSeleccionado.editable && this.archivoSeleccionado.archivoOrigenId == -1){ @@ -296,16 +302,23 @@ export class ArchivosComponent { } } }else{ - this.notifService.warning("Archivo no seleccionado"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value); } } confirmarEntrega(){ + var title = this.titlecasePipe.transform(this.translateService.get('i18n.action.send').value) + " " + + this.titlecasePipe.transform(this.translateService.get('i18n.object.file').value); + var msg = ''; + this.translateService.get('i18n.msg.file.toSend', {fileName: this.archivoSeleccionado.nombre}).subscribe((res: string) => { + msg = res + '\n' + this.translateService.get('i18n.msg.file.toSendInfo').value; + }); + let disposable = this.dialogService.addDialog(ConfirmComponent, { - title:'Entregar archivo', - message:'¿Desea entregar el archivo "'+this.archivoSeleccionado.nombre+'"?\nNo se podrá editar luego de la entrega.', - confirmText: 'Entregar', - cancelText: 'Cancelar' + title: title, + message: msg, + confirmText: this.titlecasePipe.transform(this.translateService.get('i18n.action.send')), + cancelText: this.titlecasePipe.transform(this.translateService.get('i18n.action.cancel')), }) .subscribe((isConfirmed)=>{ if(isConfirmed) { @@ -315,7 +328,7 @@ export class ArchivosComponent { } entregarArchivo(){ - this.archivoSeleccionado.estado = 'Entregado'; + this.archivoSeleccionado.estado = this.titlecasePipe.transform(this.translateService.get('i18n.action.sent')); this.haskellService.editarArchivo(this.archivoSeleccionado.id, this.archivoSeleccionado) .subscribe( archivo => { @@ -470,6 +483,7 @@ export class ArchivosComponent { this.dialogService.addDialog(CompartirArchivoComponent, { grupos:gruposRest, archivo:this.archivoSeleccionado, + nombreArchivo: {'fileName': this.archivoSeleccionado.nombre }, parent:this }) .subscribe((isConfirmed)=>{ @@ -487,6 +501,7 @@ export class ArchivosComponent { this.dialogService.addDialog(CompartirArchivoComponent, { grupos:grupos, archivo:this.archivoSeleccionado, + nombreArchivo: {'fileName': this.archivoSeleccionado.nombre }, parent:this }) .subscribe((isConfirmed)=>{ @@ -496,7 +511,7 @@ export class ArchivosComponent { }); } }else{ - this.notifService.warning("Archivo no seleccionado"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value); } } @@ -528,8 +543,4 @@ export class ArchivosComponent { } }); } - - - - } diff --git a/Frontend Angular 4/src/app/layout/archivos/archivos.module.ts b/Frontend Angular 4/src/app/layout/archivos/archivos.module.ts index 757246bce89ac97b6005a9447db97e71147f85a2..b87503528539ee227584b5ac9f3ad5e45d6d42f5 100755 --- a/Frontend Angular 4/src/app/layout/archivos/archivos.module.ts +++ b/Frontend Angular 4/src/app/layout/archivos/archivos.module.ts @@ -14,10 +14,22 @@ import { DialogService } from "ng2-bootstrap-modal"; import { BootstrapModalModule } from 'ng2-bootstrap-modal'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { CodemirrorModule } from 'ng2-codemirror'; -import { NotificacionModule } from '../../notificacion/notificacion.module'; +import { NotificacionModule } from '../../notificacion/notificacion.module'; +import { I18nModule } from '../../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../../shared/modules/titlecase.module'; @NgModule({ - imports: [CommonModule, ArchivosRoutingModule, FormsModule,BootstrapModalModule, NgbModule, CodemirrorModule,NotificacionModule], + imports: [ + CommonModule, + ArchivosRoutingModule, + FormsModule, + BootstrapModalModule, + NgbModule, + CodemirrorModule, + NotificacionModule, + I18nModule, + TitleCaseModule + ], declarations: [ArchivosComponent, FilterPipe,NuevoArchivo, VerCalificacionComponent, ConfirmComponent, CompartirArchivoComponent,ConfirmarEliminar, SeleccionarDirectorioMove], entryComponents: [ NuevoArchivo, diff --git a/Frontend Angular 4/src/app/layout/archivos/compartirArchivo.component.ts b/Frontend Angular 4/src/app/layout/archivos/compartirArchivo.component.ts index 02b5187edc781c1f383b9887da049e1cc53e6210..9b9c97a0a50ef9c69585ab7a21b9c52548b87534 100755 --- a/Frontend Angular 4/src/app/layout/archivos/compartirArchivo.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/compartirArchivo.component.ts @@ -2,18 +2,22 @@ import { Component } from '@angular/core'; import { DialogComponent, DialogService } from "ng2-bootstrap-modal"; import { Archivo } from '../../shared/objects/archivo'; import { Grupo } from '../../shared/objects/grupo'; +import { TranslateService } from '@ngx-translate/core'; export interface ConfirmModel { archivo: Archivo; grupos:any; parent:any; + nombreArchivo: { 'fileName' : string }; } @Component({ selector: 'confirm', template: `<div class="modal-dialog" style="margin-top:100px;"> <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title pull-lefth">Compartir "{{archivo.nombre}}" con:</h6> + <h6 class="modal-title pull-lefth"> + {{ "i18n.msg.file.share" | translate:nombreArchivo }} + </h6> <button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button> </div> <div class="modal-body" style="height:350px;overflow-y: scroll;"> @@ -27,7 +31,9 @@ export interface ConfirmModel { </div> </div> <div class="modal-footer"> - <button type="button" class="btn btn-primary" (click)="compartir()">Compartir</button> + <button type="button" class="btn btn-primary" (click)="compartir()"> + {{ "i18n.action.share" | translate | titleCase }} + </button> </div> </div> </div>` @@ -37,9 +43,12 @@ export class CompartirArchivoComponent extends DialogComponent<ConfirmModel, boo grupos:any; grupo: Grupo; parent: any; + nombreArchivo: { 'fileName' : string }; + translateService: any; - constructor(dialogService: DialogService) { + constructor(dialogService: DialogService, public translate: TranslateService) { super(dialogService); + this.translateService = translate; } seleccionarGrupo(grupo){ @@ -47,18 +56,19 @@ export class CompartirArchivoComponent extends DialogComponent<ConfirmModel, boo } compartir(){ + this.nombreArchivo = {'fileName' : this.archivo.nombre}; if(this.grupo){ this.parent.haskellService.compartirArchivoGrupo(this.grupo, this.archivo.id) .subscribe( success => { - this.parent.notifService.success("Archivo compartido"); + this.parent.notifService.success(this.translateService.get('i18n.msg.file.shared').value); this.close(); }, error => { this.parent.notifService.error(error); }); }else{ - this.parent.notifService.error("Seleccione un grupo"); + this.parent.notifService.error(this.translateService.get('i18n.warning.group.select').value); } } } \ No newline at end of file diff --git a/Frontend Angular 4/src/app/layout/archivos/confirmarEliminar.component.ts b/Frontend Angular 4/src/app/layout/archivos/confirmarEliminar.component.ts index 76a437deb74dbbc4cc2fb1b7ad926aa3e24e80af..d7de4a51d23a317b56fee16e9f4745d3f3a941a6 100755 --- a/Frontend Angular 4/src/app/layout/archivos/confirmarEliminar.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/confirmarEliminar.component.ts @@ -1,36 +1,51 @@ import { Component } from '@angular/core'; import { DialogComponent, DialogService } from "ng2-bootstrap-modal"; import { Archivo } from '../../shared/objects/archivo'; + export interface ConfirmModel { - nombreArchivo:string; + nombreArchivo: { fileName: string }; esDirectorio:boolean; parentContext: any; - } @Component({ selector: 'confirm', template: `<div class="modal-dialog" style="margin-top:100px;"> <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title" *ngIf="!esDirectorio">Eliminar archivo</h6> - <h6 class="modal-title" *ngIf="esDirectorio">Eliminar carpeta</h6> + <h6 class="modal-title" *ngIf="!esDirectorio"> + {{ "i18n.action.delete" | translate | titleCase }} + {{ "i18n.object.file" | translate | titleCase }} + </h6> + <h6 class="modal-title" *ngIf="esDirectorio"> + {{ "i18n.action.delete" | translate | titleCase }} + {{ "i18n.object.folder" | translate | titleCase }} + </h6> <button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button> </div> <div class="modal-body"> - <p *ngIf="!esDirectorio">¿Está seguro que desea eliminar el archivo {{nombreArchivo}}?</p> - <p *ngIf="esDirectorio">¿Está seguro que desea eliminar la carpeta {{nombreArchivo}}?</p> + <p *ngIf="!esDirectorio"> + {{ "i18n.msg.file.delete" | translate:nombreArchivo }} + </p> + <p *ngIf="esDirectorio"> + {{ "i18n.msg.file.delete" | translate:nombreArchivo }} + </p> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default" (click)="close()">Cancelar</button> - <button type="button" class="btn btn-success" (click)="confirmarEliminar()">Eliminar</button> + <button type="button" class="btn btn-default" (click)="close()"> + {{ "i18n.action.cancel" | translate | titleCase }} + </button> + <button type="button" class="btn btn-success" (click)="confirmarEliminar()"> + {{ "i18n.action.delete" | translate | titleCase }} + </button> </div> </div> </div>` }) export class ConfirmarEliminar extends DialogComponent<ConfirmModel, boolean> implements ConfirmModel { - nombreArchivo: string; + nombreArchivo: { fileName: string }; esDirectorio: boolean; parentContext: any; + constructor(dialogService: DialogService) { super(dialogService); } @@ -44,7 +59,6 @@ export class ConfirmarEliminar extends DialogComponent<ConfirmModel, boolean> im this.parentContext.haskellService.eliminarArchivo(this.parentContext.archivoSeleccionado.id) .subscribe( archivo => { - console.log("Archivo eliminado"); if(directorio){ var idDirActual = that.directorioActual.padreId; }else { diff --git a/Frontend Angular 4/src/app/layout/archivos/nuevoArchivo.component.ts b/Frontend Angular 4/src/app/layout/archivos/nuevoArchivo.component.ts index d51363e99c4abb73e8d37bfed3804858bab34ed0..4855856cc3d085621ee85dd39d96256128ba19e8 100755 --- a/Frontend Angular 4/src/app/layout/archivos/nuevoArchivo.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/nuevoArchivo.component.ts @@ -1,12 +1,13 @@ import { Component } from '@angular/core'; import { DialogComponent, DialogService } from "ng2-bootstrap-modal"; import { Archivo } from '../../shared/objects/archivo'; +import { TranslateService } from '@ngx-translate/core'; + export interface ConfirmModel { nombre:string; descripcion:string; parentContext: any; esDirectorio:boolean; - } @Component({ selector: 'confirm', @@ -14,26 +15,38 @@ export interface ConfirmModel { <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title" *ngIf="esDirectorio">Nueva carpeta</h6> - <h6 class="modal-title" *ngIf="!esDirectorio">Nuevo archivo</h6> + <h6 class="modal-title" *ngIf="esDirectorio"> + {{ "i18n.action.new" | translate | titleCase }} + {{ "i18n.object.folder" | translate | titleCase }} + </h6> + <h6 class="modal-title" *ngIf="!esDirectorio"> + {{ "i18n.action.new" | translate | titleCase }} + {{ "i18n.object.file" | translate | titleCase }} + </h6> <button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button> </div> <div class="modal-body"> <form> <div class="form-group"> - <label for="recipient-name" class="form-control-label">Nombre:</label> + <label for="recipient-name" class="form-control-label"> + {{ "i18n.object.name" | translate | titleCase }}: + </label> <input type="text" class="form-control" id="recipient-name" [(ngModel)]="nombre" [ngModelOptions]="{standalone: true}" > </div> <div class="form-group" *ngIf="esDirectorio"> - <label for="message-text" class="form-control-label">Descripción:</label> + <label for="message-text" class="form-control-label"> + {{ "i18n.object.descr" | translate | titleCase }}: + </label> <textarea class="form-control" id="message-text" [(ngModel)]="descripcion" [ngModelOptions]="{standalone: true}" ></textarea> </div> </form> </div> <div class="modal-footer"> - <button type="button" class="btn btn-success" (click)="confirm()">Crear</button> + <button type="button" class="btn btn-success" (click)="confirm()"> + {{ "i18n.action.create" | translate | titleCase }} + </button> </div> </div> @@ -44,8 +57,11 @@ export class NuevoArchivo extends DialogComponent<ConfirmModel, boolean> impleme esDirectorio: boolean; descripcion: string; parentContext: any; - constructor(dialogService: DialogService) { + translateService: any; + + constructor(dialogService: DialogService, public translate: TranslateService) { super(dialogService); + this.translateService = translate; } confirm() { var nombre = this.nombre; @@ -67,18 +83,16 @@ export class NuevoArchivo extends DialogComponent<ConfirmModel, boolean> impleme var regex = /^[A-Z]/ if(regex.test(nombre)){ this.parentContext.haskellService.crearArchivo(archivo).subscribe( - archivo => { - var id = that.directorioActual.id; - that.recargarArchivos(id); - }, - error => { - this.parentContext.notifService.error(error); - }); - - + archivo => { + var id = that.directorioActual.id; + that.recargarArchivos(id); + }, + error => { + this.parentContext.notifService.error(error); + }); this.close(); }else{ - alert("Nombre de archivo debe iniciar con mayusula.") + alert(this.translateService.get('i18n.warning.file.capitalLetter').value); } } diff --git a/Frontend Angular 4/src/app/layout/archivos/seleccionarDirectorio.component.ts b/Frontend Angular 4/src/app/layout/archivos/seleccionarDirectorio.component.ts index 9ca43a236fd7d186c80f8a4a36451e61485ec3c6..72b148900b520c656dd2ded5f06a7f6df7aa4cf1 100755 --- a/Frontend Angular 4/src/app/layout/archivos/seleccionarDirectorio.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/seleccionarDirectorio.component.ts @@ -14,7 +14,9 @@ export interface ConfirmModel { template: `<div class="modal-dialog" style="margin-top:100px;"> <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title pull-lefth">¿Dónde quieres mover el archivo?</h6> + <h6 class="modal-title pull-lefth"> + {{ "i18n.msg.file.move" | translate }} + </h6> <button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button> </div> <div class="modal-body" style="height:350px;overflow-y: scroll;"> @@ -29,8 +31,13 @@ export interface ConfirmModel { </div> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default" (click)="navBack()">Atras</button> - <button type="button" class="btn btn-primary" (click)="move()">Mover aquÃ</button> + <button type="button" class="btn btn-default" (click)="navBack()"> + {{ "i18n.action.goBack" | translate | titleCase }} + </button> + <button type="button" class="btn btn-primary" (click)="move()"> + {{ "i18n.action.move" | translate | titleCase }} + {{ "i18n.object.here" | translate }} + </button> </div> </div> </div>` diff --git a/Frontend Angular 4/src/app/layout/archivos/verCalificacion.component.ts b/Frontend Angular 4/src/app/layout/archivos/verCalificacion.component.ts index d8a438dee6482b284204af452ee57aa593478bb3..41be288d6b385f9b3cd2ebb9057bed178d93c62c 100755 --- a/Frontend Angular 4/src/app/layout/archivos/verCalificacion.component.ts +++ b/Frontend Angular 4/src/app/layout/archivos/verCalificacion.component.ts @@ -10,18 +10,22 @@ export interface ConfirmModel { template: `<div class="modal-dialog" style="margin-top:100px;"> <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title pull-lefth">Calificación "{{archivo.nombre}}":</h6> + <h6 class="modal-title pull-lefth"> + {{ "i18n.object.qualification" | translate | titleCase }} "{{archivo.nombre}}": + </h6> <button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button> </div> <div class="modal-body"> <div> - <label><b>Fecha: </b></label> {{archivo.evaluacion.fecha | date}}<br> - <label><b>Nota (1-100): </b></label> {{archivo.evaluacion.nota}}<br> - <label><b>Detalle: </b></label> {{archivo.evaluacion.descripcion}} + <label><b>{{ "i18n.object.date" | translate | titleCase }}: </b></label> {{archivo.evaluacion.fecha | date}}<br> + <label><b>{{ "i18n.objet.score" | translate | titleCase }} (1-100): </b></label> {{archivo.evaluacion.nota}}<br> + <label><b>{{ "i18n.object.detail" | translate | titleCase }}: </b></label> {{archivo.evaluacion.descripcion}} </div> </div> <div class="modal-footer"> - <button type="button" class="btn btn-primary" (click)="close()">Cerrar</button> + <button type="button" class="btn btn-primary" (click)="close()"> + {{ "i18n.action.close" | translate | titleCase }} + </button> </div> </div> </div>` diff --git a/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts b/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts index 32bf6eade13def9868c8aefd232451d909a4df76..d6a6c9cd4d28571674858ba1b947529bd86651b7 100755 --- a/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts +++ b/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { DialogComponent, DialogService } from "ng2-bootstrap-modal"; import { Archivo, Evaluacion } from '../../shared/objects/archivo'; +import { TranslateService } from '@ngx-translate/core'; export interface ConfirmModel { cedula:string; @@ -13,26 +14,26 @@ export interface ConfirmModel { <div class="modal-content"> <div class="modal-header"> - <h5 class="modal-title">Calificar entrega</h5> + <h5 class="modal-title">{{ "i18n.msg.file.qualify" | translate }}</h5> <button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button> </div> <div class="modal-body"> <form> <div class="form-group"> - <label for="message-text" class="form-control-label">Calificacion (1-100):</label> + <label for="message-text" class="form-control-label">{{ "i18n.objet.score" | translate | titleCase }} (1-100):</label> <input type="number" class="form-control" [(ngModel)]="nota" min=1 max=100 [ngModelOptions]="{standalone: true}" > </div> <div class="form-group"> - <label for="message-text" class="form-control-label">Detalle:</label> + <label for="message-text" class="form-control-label">{{ "i18n.objet.detail" | translate | titleCase }}:</label> <textarea class="form-control" id="message-text" [(ngModel)]="descripcion" [ngModelOptions]="{standalone: true}" ></textarea> </div> </form> </div> <div class="modal-footer"> - <button type="button" class="btn btn-secondary" (click)="cancel()">Cancelar</button> - <button type="button" class="btn btn-success" (click)="confirm()">Calificar</button> + <button type="button" class="btn btn-secondary" (click)="cancel()">{{ "i18n.action.cancel" | translate | titleCase }}</button> + <button type="button" class="btn btn-success" (click)="confirm()">{{ "i18n.action.qualify" | translate | titleCase }}</button> </div> </div> @@ -43,12 +44,12 @@ export class CalificarEntrega extends DialogComponent<ConfirmModel, boolean> imp cedula: string; archivo: Archivo; nota: number = 1; - + translateService: any; parentContext: any; - constructor(dialogService: DialogService) { + constructor(dialogService: DialogService, public translate: TranslateService) { super(dialogService); - + this.translateService = translate; } ngOnInit() { @@ -67,7 +68,7 @@ export class CalificarEntrega extends DialogComponent<ConfirmModel, boolean> imp this.parentContext.haskellService.calificarArchivo(this.archivo.id,evaluacion ) .subscribe( evaluacion => { - this.parentContext.notifService.success("Archivo evaluado"); + this.parentContext.notifService.success(this.translateService.get('i18n.msg.file.evaluated').value); this.archivo.evaluacion = evaluacion; this.close(); }, @@ -75,7 +76,7 @@ export class CalificarEntrega extends DialogComponent<ConfirmModel, boolean> imp this.parentContext.notifService.error(error); }); }else{ - this.parentContext.notifService.error("Calificacion fuera de rango"); + this.parentContext.notifService.error(this.translateService.get('i18n.warning.file.qualifyOutRange').value); } } diff --git a/Frontend Angular 4/src/app/layout/grupos/grupos.component.html b/Frontend Angular 4/src/app/layout/grupos/grupos.component.html index df1f27cb7efa30b930059138b30056a442b95b64..d5c0d3d0c866b50bd853d5450cd4864b5ac07bb9 100755 --- a/Frontend Angular 4/src/app/layout/grupos/grupos.component.html +++ b/Frontend Angular 4/src/app/layout/grupos/grupos.component.html @@ -37,7 +37,7 @@ <ng-template ngbTabContent> <div class="card"> <div> - <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px; margin-right: 105px;" (click)="desseleccionarGrupo()" ngbPopover="Atras" data-placement="bottom" triggers="mouseenter:mouseleave"> + <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px; margin-right: 105px;" (click)="desseleccionarGrupo()" ngbPopover='{{ "i18n.action.goBack" | translate | titleCase }}' data-placement="bottom" triggers="mouseenter:mouseleave"> <i class="fa fa-arrow-up"></i> </button> <p class="pull-right" style="margin-top: -34px; margin-right: 5px;">{{grupoSeleccionado.grado+ '°' + grupoSeleccionado.grupo+" - "+grupoSeleccionado.anio}}</p> @@ -57,7 +57,7 @@ <ng-template ngbTabContent> <div class="card"> <div> - <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px; margin-right: 105px;" (click)="desseleccionarGrupo()" ngbPopover="Atras" data-placement="bottom" triggers="mouseenter:mouseleave"> + <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px; margin-right: 105px;" (click)="desseleccionarGrupo()" ngbPopover='{{ "i18n.action.goBack" | translate | titleCase }}' data-placement="bottom" triggers="mouseenter:mouseleave"> <i class="fa fa-arrow-up"></i> </button> <p class="pull-right" style="margin-top: -34px; margin-right: 5px;">{{grupoSeleccionado.grado+ '°' + grupoSeleccionado.grupo+" - "+grupoSeleccionado.anio}}</p> diff --git a/Frontend Angular 4/src/app/layout/grupos/grupos.component.ts b/Frontend Angular 4/src/app/layout/grupos/grupos.component.ts index 29c81563d73cb8267e939a82904111d691e3a44c..4e4468458ff3cc4715e686a81f745daf90165a66 100755 --- a/Frontend Angular 4/src/app/layout/grupos/grupos.component.ts +++ b/Frontend Angular 4/src/app/layout/grupos/grupos.component.ts @@ -11,8 +11,7 @@ import { DialogService } from "ng2-bootstrap-modal"; import { CalificarEntrega } from './calificarEntrega.component'; import { NgbPopoverConfig, NgbPopover} from '@ng-bootstrap/ng-bootstrap'; import { NotificacionService } from '../../shared/services/notificacion.service'; - - +import { TranslateService } from '@ngx-translate/core'; @Component({ moduleId: module.id, @@ -36,6 +35,7 @@ export class GruposComponent { tree: any; directorioActual:any; configCodeMirror = JSON.parse(sessionStorage.getItem('codeMirrorConfig')); + translateService: any; constructor( private router: Router, @@ -43,8 +43,10 @@ export class GruposComponent { private haskellService: HaskellService, private notifService: NotificacionService, private sessionService: SessionService, - private dialogService:DialogService + private dialogService:DialogService, + public translate: TranslateService ){ + this.translateService = translate; this.directorioActual = {}; this.directorioActual.archivos = []; this.configCodeMirror.readOnly = true; @@ -164,13 +166,13 @@ export class GruposComponent { cargarArchivoCompartido(){ if(this.archivoSeleccionado){ if(this.archivoSeleccionado.directorio){ - this.notifService.warning('No se seleccionó ningún archivo',false); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value,false); }else{ this.sessionService.setArchivo(this.archivoSeleccionado); this.router.navigate(['/matefun']); } }else{ - this.notifService.warning("Archivo no seleccionado"); + this.notifService.warning(this.translateService.get('i18n.warning.file.noSelected').value); } } diff --git a/Frontend Angular 4/src/app/layout/layout.component.ts b/Frontend Angular 4/src/app/layout/layout.component.ts index b81e4b8d12417f6fd627094fc7105f75cf784224..d2220813e06643d2f57b1ed042ffe59b25475de2 100755 --- a/Frontend Angular 4/src/app/layout/layout.component.ts +++ b/Frontend Angular 4/src/app/layout/layout.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { GHCIService } from '../shared/services/ghci.service'; import { NotificacionService } from '../shared/services/notificacion.service'; +import { TranslateService } from '@ngx-translate/core'; + @Component({ selector: 'app-layout', templateUrl: './layout.component.html', @@ -9,7 +11,7 @@ import { NotificacionService } from '../shared/services/notificacion.service'; providers: [GHCIService] }) export class LayoutComponent implements OnInit { - constructor(public router: Router) { } + constructor(public router: Router, public translate: TranslateService) { } ngOnInit() { if (this.router.url === '/') { this.router.navigate(['/login']); diff --git a/Frontend Angular 4/src/app/layout/layout.module.ts b/Frontend Angular 4/src/app/layout/layout.module.ts index ab31a0b0ed8846dc4d4c027eafd5e409384201e8..e3c702bac67b0a8e94ff043842f73b5ba0e8147b 100755 --- a/Frontend Angular 4/src/app/layout/layout.module.ts +++ b/Frontend Angular 4/src/app/layout/layout.module.ts @@ -9,7 +9,9 @@ import { HeaderComponent, SidebarComponent } from '../shared'; import { AuthenticationService } from '../shared/services/authentication.service'; import { HaskellService } from '../shared/services/haskell.service'; import { CodemirrorModule } from 'ng2-codemirror'; -import { NotificacionModule } from '../notificacion/notificacion.module'; +import { NotificacionModule } from '../notificacion/notificacion.module'; +import { I18nModule } from '../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../shared/modules/titlecase.module'; @NgModule({ imports: [ @@ -18,12 +20,14 @@ import { NotificacionModule } from '../notificacion/notificacion.module'; NgbModule.forRoot(), LayoutRoutingModule, CodemirrorModule, - NotificacionModule + NotificacionModule, + I18nModule, + TitleCaseModule ], declarations: [ LayoutComponent, HeaderComponent, - SidebarComponent + SidebarComponent ], providers: [AuthenticationService, HaskellService] }) diff --git a/Frontend Angular 4/src/app/layout/matefun/confirm.component.ts b/Frontend Angular 4/src/app/layout/matefun/confirm.component.ts index f2c1c727ed9168f37172b43190eca8766b7f072d..28a8417448f4ad680e01831634005bfa64ac6030 100755 --- a/Frontend Angular 4/src/app/layout/matefun/confirm.component.ts +++ b/Frontend Angular 4/src/app/layout/matefun/confirm.component.ts @@ -16,8 +16,12 @@ export interface ConfirmModel { <p>{{message || ''}}</p> </div> <div class="modal-footer"> - <button type="button" class="btn btn-primary" (click)="confirm()">Editar</button> - <button type="button" class="btn btn-default" (click)="close()" >Cancelar</button> + <button type="button" class="btn btn-primary" (click)="confirm()"> + {{ "i18n.action.edit" | translate }} + </button> + <button type="button" class="btn btn-default" (click)="close()" > + {{ "i18n.action.cancel" | translate }} + </button> </div> </div> </div>` diff --git a/Frontend Angular 4/src/app/layout/matefun/matefun.component.html b/Frontend Angular 4/src/app/layout/matefun/matefun.component.html index 4bc4548b57441d2c4108c0090256d74772dbd10d..382026b7d5b71fb711b731b0b7cdc45d3fc5e0aa 100755 --- a/Frontend Angular 4/src/app/layout/matefun/matefun.component.html +++ b/Frontend Angular 4/src/app/layout/matefun/matefun.component.html @@ -3,7 +3,7 @@ <div class="row"> <div class="col-md-6"> <ngb-tabset [destroyOnHide]=false (tabChange)="onChangeTab($event)"> - <ngb-tab id="ProgramBtn"title="Programa"> + <ngb-tab id="ProgramBtn" title='{{ "i18n.object.program" | translate | titlecase }}'> <ng-template ngbTabContent> <div class="card"> @@ -11,41 +11,75 @@ <form> <input type="text" name="archivo" class="nomArchivoInp form-control form-control-sm" [disabled]="!archivo.editable || archivo.estado=='Corregido' || archivo.estado == 'Entregado'" - *ngIf="archivo" [(ngModel)]="archivo.nombre" (keyup)="archivoModificado()" placeholder="nombre del archivo" /> + *ngIf="archivo" [(ngModel)]="archivo.nombre" (keyup)="archivoModificado()" placeholder='{{ "i18n.msg.file.fileName" | translate }}' /> - <button style="margin-left: 5px; float: right;" id="shortcutsPopover" class="btn btn-sm btn-secondary" placement="bottom" [ngbPopover]=shortcutsPopoverContent #popover="ngbPopover" popoverTitle="Atajos del teclado" tiggers="click"> - <i class="fa fa-keyboard-o"></i> - </button> - <button id="downloadFileButton" (click)="downloadFile()" style="margin-left: 5px; float: right;" class="btn btn-sm btn-secondary" placement="bottom" ngbPopover="Exportar (Ctrl+E)" triggers="mouseenter:mouseleave" tiggers="click"> + <button + id="downloadFileButton" + (click)="downloadFile()" + style="margin-left: 10px; float: right;" + class="btn btn-sm btn-secondary" + placement="bottom" + ngbPopover='{{ "i18n.action.export" | translate | titleCase }} (Ctrl+E)' + triggers="mouseenter:mouseleave" + tiggers="click"> <i class="fa fa-download "></i> </button> - <button style="margin-left: 5px; float: right;" id="popover" class="btn btn-sm btn-secondary" placement="bottom" [ngbPopover]=popoverContent #popover="ngbPopover" popoverTitle="Configuración" tiggers="click"> + <button + style="margin-left: 10px; float: right;" + id="popover" class="btn btn-sm btn-secondary" + placement="bottom" + [ngbPopover]=popoverContent + #popover="ngbPopover" + popoverTitle='{{ "i18n.object.settings" | translate | titleCase }}' + tiggers="click"> <i class="fa fa-gear"></i> </button> - <div style="margin-left: 5px; float: right;" ngbPopover="Guardar archivo (Ctrl+G)" triggers="mouseenter:mouseleave" placement="bottom" > + <div + style="margin-left: 10px; float: right;" + ngbPopover='{{ "i18n.action.save" | translate | titleCase }} {{ "i18n.object.file" | translate | titleCase }} (Ctrl+G)' + triggers="mouseenter:mouseleave" + placement="bottom" > <button [disabled]="!modificado" (click)="guardarArchivo()" class="btn btn-sm btn-secondary" > <i class="fa fa-save"></i> </button> </div> - <button style="margin-left: 5px; float: right;" (click)="reiniciarInterprete()" class="btn btn-sm btn-secondary" ngbPopover="Reiniciar intérprete (Ctrl+R)" triggers="mouseenter:mouseleave" placement="bottom"> + <button + style="margin-left: 10px; float: right;" + (click)="reiniciarInterprete()" + class="btn btn-sm btn-secondary" + ngbPopover='{{ "i18n.action.restart" | translate | titleCase }} {{ "i18n.object.interpreter" | translate | titleCase }} (Ctrl+R)' + triggers="mouseenter:mouseleave" + placement="bottom"> <i class="fa fa-refresh"></i> </button> - <button style="margin-left: 5px; float: right;" (click)="runCode()" class="btn btn-sm btn-secondary" ngbPopover="Cargar programa (Ctrl+P)" triggers="mouseenter:mouseleave" placement="bottom"> + <button + style="margin-left: 10px; float: right;" + (click)="runCode()" + class="btn btn-sm btn-secondary" + ngbPopover='{{ "i18n.action.load" | translate | titleCase }} {{ "i18n.object.program" | translate | titleCase }} (Ctrl+P)' + triggers="mouseenter:mouseleave" + placement="bottom"> <i class="fa fa-play"></i> </button> - <button style="float: right;" (click)="seleccionarDirectorio()" class="btn btn-sm btn-secondary" ngbPopover="Nuevo archivo (Ctrl+A)" triggers="mouseenter:mouseleave" placement="bottom"> + <button + style="float: right;" + (click)="seleccionarDirectorio()" + class="btn btn-sm btn-secondary" + ngbPopover='{{ "i18n.action.new" | translate | titleCase }} {{ "i18n.object.file" | translate | titleCase }} (Ctrl+A)' + triggers="mouseenter:mouseleave" + placement="bottom"> <i class="fa fa-plus"></i> </button> <ng-template #popoverContent style="width: 15em"> <div style="width: 12em"> <div class="form-group"> - <label>Tema:</label> + <label>{{ "i18n.object.theme" | translate | titleCase }}:</label> <select name="theme" class="form-control form-control-sm" #selectTheme (change)=updateConfig(selectTheme.value)> <option *ngFor="let theme of themes" [selected]="theme==configCodeMirror.theme" value='{{theme}}'>{{theme}}</option> </select> </div> <div class="form-group"> - <label>Tamaño de fuente:</label> + <label>{{ "i18n.msg.codemirror.fontSize" | translate }}:</label> <div> <button class="btn btn-sm btn-secondary" (click)="aumentarFuente()">Aâº</button> <button class="btn btn-sm btn-secondary" (click)="disminuirFuente()">Aâ»</button> @@ -55,12 +89,13 @@ <div class="form-group"> <label> <input type="checkbox" style="width: 15px; display: inline-block;" name="argumentoF" class="form-control form-control-sm" [(ngModel)]=argumentoF> - Mostrar advertencias de uso de funciones + {{ "i18n.msg.codemirror.functionWarnings" | translate }} </label> <br> <label> <input type="checkbox" style="width: 15px; display: inline-block;" name="argumentoI" class="form-control form-control-sm" [(ngModel)]=argumentoI> - Mostrar advertencias de uso de operadores infijos + {{ "i18n.msg.codemirror.infixOperatorsWarnings" | translate }} + </label> <br> <label> @@ -69,7 +104,7 @@ </label> </div> <div class="form-group"> - <button class="btn btn-secondary" (click)="saveConfig()">Guardar</button> + <button class="btn btn-secondary" (click)="saveConfig()">{{ "i18n.action.save" | translate | titleCase }}</button> </div> </div> </ng-template> @@ -99,12 +134,12 @@ <canvas-component (canvasComp)=canvasC></canvas-component> </ng-template> </ngb-tab> --> - <ngb-tab id="FigurasBtn2D" title="Figuras 2D"> + <ngb-tab id="FigurasBtn2D" title='{{ "i18n.object.figures" | translate | titleCase }} 2D'> <ng-template ngbTabContent> <graph2D-component (graph2DComp)=graph2DComp></graph2D-component> </ng-template> </ngb-tab> - <ngb-tab id="FigurasBtn3D" title="Figuras 3D"> + <ngb-tab id="FigurasBtn3D" title='{{ "i18n.object.figures" | translate | titleCase }} 3D'> <ng-template ngbTabContent> <graph3d-component (graph3DComp)=graph3DComp></graph3d-component> </ng-template> diff --git a/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts b/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts index f7b1144cb1281707c4dc46e7816fce8f74dcd54f..6ad29206b9639440f7de72aad2b5b506593b66bf 100755 --- a/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts +++ b/Frontend Angular 4/src/app/layout/matefun/matefun.component.ts @@ -22,6 +22,8 @@ import { NotificacionService } from '../../shared/services/notificacion.service' import { Graph2DModule } from '../plotter/graph2D/graph2D.module'; import { Graph2DComponent } from '../plotter/graph2D/graph2D.component'; import { Graph3DComponent } from '../plotter/graph3D/graph3D.component'; +import { TranslateService } from '@ngx-translate/core'; +import { TitleCasePipe } from '../../shared/pipes/titlecase.pipe'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/map'; @@ -50,6 +52,7 @@ import * as npm from './../../../../package.json' var codeMirrorRef:any; var componentRef : any; var focus: any; + @Component({ moduleId: module.id, selector: 'matefun', @@ -60,7 +63,8 @@ var focus: any; export class MateFunComponent { - + titlecasePipe: any; + translateService: any; consoleDisable: boolean = false; consolaVisible: boolean = true; cursorPanel: any; @@ -109,7 +113,13 @@ export class MateFunComponent { private notifService: NotificacionService, private sessionService: SessionService, private dialogService:DialogService, - private usuarioService: UsuarioService) { + private usuarioService: UsuarioService, + public translate: TranslateService) { + + // i18n + this.translateService = translate; + this.titlecasePipe = new TitleCasePipe(); + //si el archivo fue seteado en la session. this.archivo = sessionService.getArchivo(); if(!this.archivo || !this.archivo.id){ @@ -178,7 +188,8 @@ export class MateFunComponent { var y = cm.getCursor().ch; x = (Number(x) + 1).toString(); y = (Number(y) + 1).toString(); - this.cursorPanelLabel.textContent = "Posición del cursor: (" + x + "," + y + ")"; + var cursorPositionTranslate = this.translateService.get('i18n.msg.codemirror.cursorPosition').value; + this.cursorPanelLabel.textContent = cursorPositionTranslate + ": (" + x + "," + y + ")"; this.cursorPanel = this.codemirror.instance.addPanel(node, {position: "bottom", stable: true}); @@ -189,7 +200,7 @@ export class MateFunComponent { var y = cm.getCursor().ch; x = (Number(x) + 1).toString(); y = (Number(y) + 1).toString(); - that.cursorPanel.node.innerText = "Posición del cursor: (" + x + "," + y + ")"; + that.cursorPanel.node.innerText = cursorPositionTranslate + ": (" + x + "," + y + ")"; }); this.codemirror.instance.on("keyHandled",function(cm,name,evt){ diff --git a/Frontend Angular 4/src/app/layout/matefun/matefun.module.ts b/Frontend Angular 4/src/app/layout/matefun/matefun.module.ts index d250a595a34c881ae7509ec6869ef0571dc2021b..80eba443c8658a5680e24a70d30fa7b2f35a2edd 100755 --- a/Frontend Angular 4/src/app/layout/matefun/matefun.module.ts +++ b/Frontend Angular 4/src/app/layout/matefun/matefun.module.ts @@ -12,19 +12,23 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NotificacionModule } from '../../notificacion/notificacion.module'; import { Graph2DModule } from '../plotter/graph2D/graph2D.module'; import { Graph3DModule } from '../plotter/graph3D/graph3D.module'; +import { I18nModule } from '../../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../../shared/modules/titlecase.module'; @NgModule({ imports: [ - CommonModule, - FormsModule, - CanvasModule, - Graph2DModule, - Graph3DModule, - NotificacionModule, - MateFunRoutingModule, - CodemirrorModule, - NgbModule, - BootstrapModalModule + CommonModule, + FormsModule, + CanvasModule, + Graph2DModule, + Graph3DModule, + NotificacionModule, + MateFunRoutingModule, + CodemirrorModule, + NgbModule, + BootstrapModalModule, + I18nModule, + TitleCaseModule ], entryComponents: [ ConfirmComponent, diff --git a/Frontend Angular 4/src/app/layout/matefun/seleccionarDirectorio.component.ts b/Frontend Angular 4/src/app/layout/matefun/seleccionarDirectorio.component.ts index 90625e8808784168852459fff0454f3ad6181bce..68171bcd86841763b736d3819dfffd935e9fa275 100755 --- a/Frontend Angular 4/src/app/layout/matefun/seleccionarDirectorio.component.ts +++ b/Frontend Angular 4/src/app/layout/matefun/seleccionarDirectorio.component.ts @@ -1,6 +1,8 @@ import { Component } from '@angular/core'; import { DialogComponent, DialogService } from "ng2-bootstrap-modal"; import { Archivo } from '../../shared/objects/archivo'; +import { TranslateService } from '@ngx-translate/core'; + export interface ConfirmModel { title:string; message:string; @@ -14,13 +16,15 @@ export interface ConfirmModel { template: `<div class="modal-dialog" style="margin-top:100px;"> <div class="modal-content"> <div class="modal-header"> - <h6 class="modal-title pull-lefth">¿Dónde quieres crear el archivo?</h6> + <h6 class="modal-title pull-lefth"> + {{ "i18n.msg.file.create" | translate }} + </h6> <button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button> </div> <div class="modal-body" style="height:350px;overflow-y: scroll;"> <div> <div class="form-group"> - <label for="file-name" class="form-control-label">Nombre:</label> + <label for="file-name" class="form-control-label">{{ "i18n.object.name" | translate | titleCase }}:</label> <input type="text" class="form-control" id="file-name" [(ngModel)]="nombre" > </div> <div class="list-group" > @@ -33,8 +37,12 @@ export interface ConfirmModel { </div> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default" (click)="navBack()">Atras</button> - <button type="button" class="btn btn-primary" (click)="confirm()">Crear</button> + <button type="button" class="btn btn-default" (click)="navBack()"> + {{ "i18n.action.goBack" | translate | titleCase }} + </button> + <button type="button" class="btn btn-primary" (click)="confirm()"> + {{ "i18n.action.create" | translate | titleCase }} + </button> </div> </div> </div>` @@ -46,18 +54,20 @@ export class SeleccionarDirectorioComp extends DialogComponent<ConfirmModel, boo directorioActual:any; parent:any; nombre:string; + translateService: any; - constructor(dialogService: DialogService) { + constructor(dialogService: DialogService, public translate: TranslateService) { super(dialogService); + this.translateService = translate; } confirm() { // we set dialog result as true on click on confirm button, // then we can get dialog result from caller code var regex = /^[A-Z]/ if(this.nombre==undefined || this.nombre==""){ - this.parent.notifService.error("Nombre de archivo invalido."); + this.parent.notifService.error(this.translateService.get('i18n.warning.file.invalidName').value); }else if (!regex.test(this.nombre)){ - this.parent.notifService.error("Nombre de archivo debe iniciar con mayusula."); + this.parent.notifService.error(this.translateService.get('i18n.warning.file.capitalLetter').value); }else{ var archivo:Archivo = new Archivo(); archivo.cedulaCreador = this.parent.authService.getUser().cedula; diff --git a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.html b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.html index 1892329815bd7f9dc3c7a31fbd3a4c4d43d353a2..dcab32fe04457798b4409b4d3bb5cca26d4bb7cb 100755 --- a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.html +++ b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.html @@ -1,34 +1,34 @@ <!-- Buttons Controls --> <div class="buttons-control"> - <button ngbPopover="Zoom +" + <button ngbPopover='{{ "i18n.action.zoom" | translate | titleCase }} +' class="btn btn-sm btn-secondary btn-zoom-increase" data-placement="bottom" triggers="mouseenter:mouseleave" (click)=zoomIn() > <i class="fa fa-plus"></i> </button> - <button ngbPopover="Zoom -" + <button ngbPopover='{{ "i18n.action.zoom" | translate | titleCase }} -' class="btn btn-sm btn-secondary btn-zoom-decrease" data-placement="bottom" triggers="mouseenter:mouseleave" (click)=zoomOut() > <i class="fa fa-minus"></i> </button> - <button ngbPopover="Centrar" + <button ngbPopover='{{ "i18n.action.center" | translate | titleCase }}' class="btn btn-sm btn-secondary btn-zoom-center" data-placement="bottom" triggers="mouseenter:mouseleave" (click)="recenterPlot()" > <i class="fa fa-arrows"></i> </button> - <button ngbPopover="Borrar" + <button ngbPopover='{{ "i18n.action.delete" | translate | titleCase }}' class="btn btn-sm btn-secondary btn-trash" data-placement="bottom" triggers="mouseenter:mouseleave" (click)="cleanPlot()" > <i class="fa fa-trash"></i> </button> - <button ngbPopover="Descargar PNG" + <button ngbPopover='{{ "i18n.action.download" | translate | titleCase }} PNG' class="btn btn-sm btn-secondary btn-download" data-placement="bottom" triggers="mouseenter:mouseleave" @@ -40,7 +40,7 @@ placement="bottom" closePopoverDirective [ngbPopover]=popoverCanvas - popoverTitle="Configuración" + popoverTitle='{{ "i18n.object.settings" | translate | titleCase }}' #popover="ngbPopover" tiggers="click"> <i class="fa fa-gear"></i> @@ -65,7 +65,7 @@ class="form-control form-control-sm" [checked]= settings.grid (click)="toggleGrid()"> - Grilla + {{ "i18n.object.grid" | translate | titleCase }} </label> <label> <input @@ -74,7 +74,7 @@ class="form-control form-control-sm" [checked]= settings.axis (click)="toggleAxis()"> - Ejes + {{ "i18n.object.axes" | translate | titleCase }} </label> <label> <input @@ -83,7 +83,7 @@ class="form-control form-control-sm" [checked]= settings.tip (click)="toggleTip()"> - Tip + {{ "i18n.object.tip" | translate | titleCase }} </label> <label [class.disabled]="funciones.length === 0"> <input @@ -91,14 +91,14 @@ [attr.disabled]="funciones.length === 0 ? '' : null" [checked]=animation.boton (click)="multiGraf(value)"> - Multi gráfica + {{ "i18n.msg.figure.multiPlot" | translate | titleCase }} </label> </div> <hr> <div class="zoom-control setting-section"> <div [class.disabled]="funciones.length === 0" style="display: flex;"> <span style="margin-right: 8px; align-self: center;"> - Zoom + {{ "i18n.action.zoom" | translate | titleCase }} </span> <input type="number" @@ -115,7 +115,7 @@ <hr> <div class="animation-controls setting-section" [class.disabled]="animation.data.length === 0"> - <label>Velocidad de animación:</label> + <label>{{ "i18n.msg.figure.animationSpeed" | translate }}:</label> <div> <button class="btn btn-sm btn-secondary" [attr.disabled]="animation.data.length === 0 ? '' : null" diff --git a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts index 4095999a27f88f744e71a1d27cfcc4a5eb3d54aa..cfb2cba8c2258a4363c92a34bcd6f230a9d61d57 100755 --- a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts @@ -2,6 +2,7 @@ import { Component, ViewChild, ElementRef } from '@angular/core'; import { GHCIService } from '../../../shared/services/ghci.service'; import functionPlot from 'function-plot'; import { Animation, Setting, toJSON, triggerDownload } from './graph2D.helper'; +import { TranslateService } from '@ngx-translate/core'; @Component({ moduleId: module.id, @@ -66,7 +67,7 @@ export class Graph2DComponent { public multiGraf = () => { this.animation.boton = !this.animation.boton; } - public constructor(private ghciService: GHCIService) { + public constructor(private ghciService: GHCIService, public translate: TranslateService) { this.ghciServiceSub = ghciService.messages.subscribe( canvas => { // Stop Animation diff --git a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.module.ts b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.module.ts index 3d1ba823717d7ca240f4da0d6a9570f6c3b1d4a4..f29f0b5a9a73dd91fda42bbbbaafe9f694332f2c 100755 --- a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.module.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.module.ts @@ -5,9 +5,19 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { FormsModule } from '@angular/forms'; import { Graph2DComponent } from './graph2D.component'; import { DirectivesModule } from '../../../shared/directives/directives.module'; +import { I18nModule } from '../../../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../../../shared/modules/titlecase.module'; @NgModule({ - imports: [FormsModule, RouterModule, CommonModule, NgbModule, DirectivesModule], + imports: [ + FormsModule, + RouterModule, + CommonModule, + NgbModule, + DirectivesModule, + I18nModule, + TitleCaseModule + ], declarations: [Graph2DComponent], exports: [Graph2DComponent], }) diff --git a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.html b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.html index e882a923967cdd1a0ad585f7ee7040bc8dbe92ea..ebbaeb876c7b511198cacfcfeff7e1b1fcd9aa02 100644 --- a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.html +++ b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.html @@ -5,8 +5,7 @@ type="button" class="btn btn-secondary" style="min-width: 70px;" - (click)=changeZoomType() - > + (click)=changeZoomType()> {{getZoom3DTypeName(graphProps.zoomType)}} </button> <div class="btn-group" ngbDropdown role="group" aria-label="Button group with nested dropdown"> @@ -16,8 +15,7 @@ *ngFor="let type of [1,2,3,4]" class="dropdown-item" [disabled]="type === graphProps.zoomType" - (click)=changeZoomType(type) - > + (click)=changeZoomType(type)> {{getZoom3DTypeName(type)}} </button> </div> @@ -25,32 +23,29 @@ </div> <button - ngbPopover="Zoom +" + ngbPopover='{{ "i18n.action.zoom" | translate | titleCase}} +' triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary" - (click)=zoomIn() - > + (click)=zoomIn() > <i class="fa fa-plus"></i> </button> <button - ngbPopover="Zoom -" + ngbPopover='{{ "i18n.action.zoom" | translate | titleCase}} -' triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary" - (click)=zoomOut() - > + (click)=zoomOut() > <i class="fa fa-minus"></i> </button> <button - ngbPopover="Centrar" + ngbPopover='{{ "i18n.action.center" | translate | titleCase}}' triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary" - (click)=center() - > + (click)=center() > <i class="fa fa-arrows"></i> </button> @@ -61,8 +56,7 @@ [ngbPopover]=popoverAxesSize popoverTitle="Rango de ejes" #popover="ngbPopover" - tiggers="click" - > + tiggers="click"> <i class="fa fa-arrows-h"></i> </button> <ng-template #popoverAxesSize> @@ -140,12 +134,11 @@ <button - ngbPopover="Borrar" + ngbPopover='{{ "i18n.action.delete" | translate | titleCase }}' triggers="mouseenter:mouseleave" data-placement="bottom" class="btn btn-sm btn-secondary" - (click)=clear() - > + (click)=clear() > <i class="fa fa-trash"></i> </button> @@ -155,7 +148,7 @@ placement="bottom" tiggers="click" class="btn btn-sm btn-secondary" - popoverTitle="Configuración" + popoverTitle='{{ "i18n.object.settings" | translate | titleCase }}' > <i class="fa fa-gear"></i> </button> @@ -164,12 +157,12 @@ <div style="width: 140px;"> <label class="d-block"> <input type="checkbox"[checked]=graphProps.showAxes (click)="changeAxesVisibility()"> - Mostrar grilla + {{ "i18n.object.grid" | translate | titleCase }} </label> <div style="display: flex;"> <span style="margin-right: 8px; align-self: center;"> - Quality: + {{ "i18n.object.quality" | translate | titleCase }}: </span> <input diff --git a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts index c41ac45244cadfb9661d4accbac62443cc067abe..1497584f994f1f2b41d24bb7505eba2f9728cd84 100644 --- a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit, ViewChild, ElementRef, NgZone, AfterViewInit } from import * as graph3DLib from 'graph3D'; import { GHCIService } from '../../../shared/services/ghci.service'; import { formatJSON, AnimationProps, Zoom3DType, GraphProps, Default_GraphProps, debounce } from './graph3D.helper'; +import { TranslateService } from '@ngx-translate/core'; +import { TitleCasePipe } from '../../../shared/pipes/titlecase.pipe'; @Component({ selector: 'graph3d-component', @@ -15,6 +17,9 @@ export class Graph3DComponent implements AfterViewInit { private ghciServiceSub: any; + private translateService: any; + private titlecasePipe: any; + @ViewChild('graph3DElement') private graph3DRef: ElementRef; @@ -27,9 +32,13 @@ export class Graph3DComponent implements AfterViewInit { speed: 1000 }; - constructor(ghciService: GHCIService, private zone: NgZone) { + constructor(ghciService: GHCIService, private zone: NgZone, public translate: TranslateService) { const self = this; + // i18n + this.translateService = translate; + this.titlecasePipe = new TitleCasePipe(); + this.ghciServiceSub = ghciService.messages.subscribe( message => { if (message.tipo == "canvas3D") { @@ -177,13 +186,13 @@ export class Graph3DComponent implements AfterViewInit { public getZoom3DTypeName = (type: Zoom3DType) => { switch (type) { case Zoom3DType.Normal: - return 'Normal'; + return this.titlecasePipe.transform(this.translateService.get('i18n.object.normal').value); case Zoom3DType.XAxis: - return 'Eje x'; + return this.titlecasePipe.transform(this.translateService.get('i18n.object.axis').value) + ' x'; case Zoom3DType.YAxis: - return 'Eje y'; + return this.titlecasePipe.transform(this.translateService.get('i18n.object.axis').value) + ' y'; case Zoom3DType.ZAxis: - return 'Eje z'; + return this.titlecasePipe.transform(this.translateService.get('i18n.object.axis').value) + ' z'; } } } diff --git a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.module.ts b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.module.ts index 21c2517ff2a4c824ad335e8b2f6fe0730301fafe..d39268b5571eb8fc49ce764dedb871ac7d40115e 100644 --- a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.module.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.module.ts @@ -6,10 +6,19 @@ import { FormsModule } from '@angular/forms'; import { Graph3DComponent } from './graph3D.component'; import { AnimationControlComponent } from '../animation-control/animation-control.component'; import { DirectivesModule } from '../../../shared/directives/directives.module'; - +import { I18nModule } from '../../../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../../../shared/modules/titlecase.module'; @NgModule({ - imports: [FormsModule, RouterModule, CommonModule, NgbModule, DirectivesModule], + imports: [ + FormsModule, + RouterModule, + CommonModule, + NgbModule, + DirectivesModule, + I18nModule, + TitleCaseModule + ], declarations: [ AnimationControlComponent, Graph3DComponent diff --git a/Frontend Angular 4/src/app/login/login.component.html b/Frontend Angular 4/src/app/login/login.component.html index 25c3e4c7211070097f2c368be215201eb7ced458..51805f4cb963e74ab629a71c6d860870b45656a4 100755 --- a/Frontend Angular 4/src/app/login/login.component.html +++ b/Frontend Angular 4/src/app/login/login.component.html @@ -5,25 +5,40 @@ <form role="form"> <div class="form-content"> <div class="form-group"> - <input type="text" [(ngModel)]=model.cedula name="cedula" class="form-control input-underline input-lg" placeholder="Usuario"> + <input type="text" [(ngModel)]=model.cedula name="cedula" class="form-control input-underline input-lg" placeholder='{{ "i18n.object.user" | translate | titleCase }}'> </div> <div class="form-group"> - <input type="password" [(ngModel)]=model.password (keyup.enter)=login() name="password" class="form-control input-underline input-lg" placeholder="Contraseña"> + <input + type="password" + [(ngModel)]=model.password + (keyup.enter)=login() + name="password" + class="form-control input-underline input-lg" + placeholder='{{ "i18n.object.password" | translate | titleCase }}'> </div> - <div class="form-group" style="margin-bottom: 0px;"> - <div ngbDropdown class="d-inline-block"> - <button class="btn btn-outline-secondary" id="input-lang" ngbDropdownToggle>{{model.language.name}}</button> + <div class="form-group" style="margin-bottom: 0px; text-align: left;"> + <div ngbDropdown class="d-inline-block language-switcher"> + <button class="btn btn-outline-secondary" id="input-lang" ngbDropdownToggle> + <span class="flag-icon flag-icon-{{model.language.flagCode}}"></span> + {{model.language.name}} + </button> <div class="dropdown-menu" aria-labelledby="input-lang"> - <button class="dropdown-item" *ngFor="let lang of languages" (click)="model.language = lang" >{{lang.name}}</button> + <div class="dropdown-menu-front"> + <div class="dropdown-menu-content"> + <button class="dropdown-item" *ngFor="let lang of languages" (click)="onChangeLanguage(lang)" > + <span class="flag-icon flag-icon-{{lang.flagCode}}"></span> + {{lang.name}} + </button> + </div> + </div> </div> - </div> - + </div> </div> </div> - <a class="btn rounded-btn" style="background: transparent;color: white;cursor: pointer;width: 159px;margin-right: 3px;" (click)=login()> Iniciar Sesión </a> - <a class="btn rounded-btn" style="background: transparent;color: white;cursor: pointer;width: 159px;margin-left: 3px;" (click)=invitado()> Invitado </a> + <a class="btn rounded-btn" style="background: transparent;color: white;cursor: pointer;width: 159px;margin-right: 3px;" (click)=login()> {{ "i18n.action.login" | translate | titleCase }} </a> + <a class="btn rounded-btn" style="background: transparent;color: white;cursor: pointer;width: 159px;margin-left: 3px;" (click)=invitado()> {{ "i18n.object.guest" | translate | titleCase }} </a> <div class="loading" *ngIf="loading"> <div class="loading-bar"></div> diff --git a/Frontend Angular 4/src/app/login/login.component.scss b/Frontend Angular 4/src/app/login/login.component.scss index 92ee5466c358a42d782a3892bebf02c3424934c1..e0b6be881c0494298ddfc6c64b51bde028af4f97 100755 --- a/Frontend Angular 4/src/app/login/login.component.scss +++ b/Frontend Angular 4/src/app/login/login.component.scss @@ -103,3 +103,35 @@ $topnav-background-color: #222; position: relative; top: 20px; } + + +.language-switcher { + button { + color: #ccc; + border: 0px; + background-color: transparent; + &:hover, &:active { + background-color: rgba(255,255,255,0.15); + } + &:focus { + box-shadow: none; + } + } + .flag-icon { + margin-right: 10px; + } + .dropdown-menu { + padding: 0px; + margin: 0.5rem 0; + background-color: #004869; + &-front { + background-color: rgba(255,255,255,0.15); + } + &-content { + padding: 0.5rem 0; + } + } + .dropdown-item { + padding-left: 15px; + } +} \ No newline at end of file diff --git a/Frontend Angular 4/src/app/login/login.component.ts b/Frontend Angular 4/src/app/login/login.component.ts index 82f555ebd087abd9cde6dab32f0f04632cd2e42a..d7a6dd2e8488b9c9db6b3e18255f92f0258b3a22 100755 --- a/Frontend Angular 4/src/app/login/login.component.ts +++ b/Frontend Angular 4/src/app/login/login.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { SessionService } from '../shared/services/session.service'; import { AuthenticationService } from '../shared/services/authentication.service'; +import { TranslateService } from '@ngx-translate/core'; @Component({ @@ -13,8 +14,8 @@ import { AuthenticationService } from '../shared/services/authentication.service export class LoginComponent implements OnInit { languages = [ - {id: 0, name: "Ingles", code: 'en'}, - {id: 1, name: "Español", code: 'es'} + {id: 0, name: "Español", code: 'es', flagCode: 'es'}, + {id: 1, name: "English", code: 'en', flagCode: 'us'} ]; model: any = { @@ -32,9 +33,16 @@ export class LoginComponent implements OnInit { private router: Router, private sessionService: SessionService, private authenticationService: AuthenticationService, + public translate: TranslateService ) { } ngOnInit() { + let currentSession = sessionStorage.getItem("currentUser"); + let langCode = currentSession ? JSON.parse(currentSession).language : 'es'; + if (langCode) { + this.model.language = this.getLanguageElementByCode(langCode); + } + // reset login status this.authenticationService.logout(); @@ -48,6 +56,7 @@ export class LoginComponent implements OnInit { var that = this; + this.translate.use(this.model.language.code); this.authenticationService.login(this.model.cedula, this.model.password, this.model.language.code) .subscribe( data => { @@ -76,4 +85,20 @@ export class LoginComponent implements OnInit { }); } + onChangeLanguage(lang) { + this.model.language = lang; + this.translate.use(this.model.language.code); + } + + getLanguageElementByCode(code) { + let langElement = null; + for(let lang of this.languages) { + if (lang.code === code) { + langElement = lang; + break; + } + }; + return langElement; + } + } diff --git a/Frontend Angular 4/src/app/login/login.module.ts b/Frontend Angular 4/src/app/login/login.module.ts index 8d8c187f673ea0d5097a98198783212ed16f67a9..48e2edf2ac6a03efeb7b7c50751c45bc5f84e8ad 100755 --- a/Frontend Angular 4/src/app/login/login.module.ts +++ b/Frontend Angular 4/src/app/login/login.module.ts @@ -7,12 +7,16 @@ import { LoginRoutingModule } from './login-routing.module'; import { LoginComponent } from './login.component'; import { FormsModule } from '@angular/forms'; import { AuthenticationService } from '../shared/services/authentication.service'; +import { I18nModule } from '../shared/modules/translate/i18n.module'; +import { TitleCaseModule } from '../shared/modules/titlecase.module'; @NgModule({ imports: [ FormsModule, CommonModule, LoginRoutingModule, + I18nModule, + TitleCaseModule, NgbModule.forRoot(), ], declarations: [LoginComponent], diff --git a/Frontend Angular 4/src/app/shared/components/header/header.component.html b/Frontend Angular 4/src/app/shared/components/header/header.component.html index 7b31ad18af849aed73310ab4aeb0a518445af2dd..3a577396be6bb8591c8df859227f2680da07c6b8 100755 --- a/Frontend Angular 4/src/app/shared/components/header/header.component.html +++ b/Frontend Angular 4/src/app/shared/components/header/header.component.html @@ -11,7 +11,9 @@ <i class="fa fa-user"></i> {{usuario.nombre+' '+usuario.apellido}}<b class="caret"></b> </a> <div class="dropdown-menu dropdown-menu-right"> - <a class="dropdown-item" style="cursor: pointer;" (click)=logout() ><i class="fa fa-fw fa-power-off"></i> Salir</a> + <a class="dropdown-item" style="cursor: pointer;" (click)=logout() ><i class="fa fa-fw fa-power-off"></i> + {{ "i18n.action.exit" | translate | titleCase }} + </a> </div> </div> </ul> diff --git a/Frontend Angular 4/src/app/shared/components/sidebar/sidebar.component.html b/Frontend Angular 4/src/app/shared/components/sidebar/sidebar.component.html index 15938e99fab4aeef75a15cc4fb010439a41b3594..8b7f5eac89481b5f9cafb9c453f0378631df6796 100755 --- a/Frontend Angular 4/src/app/shared/components/sidebar/sidebar.component.html +++ b/Frontend Angular 4/src/app/shared/components/sidebar/sidebar.component.html @@ -1,13 +1,13 @@ <nav class="sidebar" #sidebarNav [ngClass]="{sidebarPushRight: isActive}" style="background: #036b9a !important;"> <ul class="list-group"> <a [routerLink]="['/matefun']" (click)=toggleSidebar() [routerLinkActive]="['router-link-active']" class="list-group-item" style="color: white;"> - <i class="fa fa-fw fa-desktop"></i> Programa + <i class="fa fa-fw fa-desktop"></i> {{ "i18n.object.program" | translate | titleCase }} </a> <a [routerLink]="['/archivos']" (click)=toggleSidebar() [routerLinkActive]="['router-link-active']" class="list-group-item" style="color: white;"> - <i class="fa fa-fw fa-file-o"></i> Archivos + <i class="fa fa-fw fa-file-o"></i> {{ "i18n.object.files" | translate | titleCase }} </a> <a *ngIf="esDocente()" [routerLink]="['/grupos']" (click)=toggleSidebar() [routerLinkActive]="['router-link-active']" class="list-group-item" style="color: white;"> - <i class="fa fa-fw fa-users"></i> Grupos + <i class="fa fa-fw fa-users"></i> {{ "i18n.object.groups" | translate | titleCase }} </a> </ul> diff --git a/Frontend Angular 4/src/app/shared/config.ts b/Frontend Angular 4/src/app/shared/config.ts index ff7baec48f045a2981973a0700d5e3fd6ff60bc2..ea17a3bf1296cee710c4d37f4ffb64272b3f1a75 100755 --- a/Frontend Angular 4/src/app/shared/config.ts +++ b/Frontend Angular 4/src/app/shared/config.ts @@ -19,3 +19,6 @@ // Google cloud platform export const SERVER = 'http://35.199.110.129:9090'; export const GHCI_URL = 'ws://35.199.110.129:9090/endpoint'; + +// export const SERVER = 'http://localhost:8080'; +// export const GHCI_URL = 'ws://localhost:8080/endpoint'; diff --git a/Frontend Angular 4/src/app/shared/modal/confirm.component.ts b/Frontend Angular 4/src/app/shared/modal/confirm.component.ts index 24b626427aa060c9faedd0e68e469f7dc5c628cc..f6c7eb39d14e40c1c889e6b6356eb1876c147fea 100755 --- a/Frontend Angular 4/src/app/shared/modal/confirm.component.ts +++ b/Frontend Angular 4/src/app/shared/modal/confirm.component.ts @@ -18,8 +18,8 @@ export interface ConfirmModel { <p style="white-space: pre;">{{message || ''}}</p> </div> <div class="modal-footer"> - <button type="button" class="btn btn-primary" (click)="confirm()">{{confirmText || 'Confirmar'}}</button> - <button type="button" class="btn btn-default" (click)="close()" >{{cancelText || 'Cancelar'}}</button> + <button type="button" class="btn btn-primary" (click)="confirm()">{{confirmText || "i18n.action.confirm" | translate | titleCase }}</button> + <button type="button" class="btn btn-default" (click)="close()" >{{cancelText || "i18n.action.cancel" | translate | titleCase }}</button> </div> </div> </div>` diff --git a/Frontend Angular 4/src/app/shared/modules/index.ts b/Frontend Angular 4/src/app/shared/modules/index.ts index 7afde6126c9534188e86e3872197a7e7d91888d4..b20424b72f409f49278df210a4649375657a00d8 100755 --- a/Frontend Angular 4/src/app/shared/modules/index.ts +++ b/Frontend Angular 4/src/app/shared/modules/index.ts @@ -1,2 +1,3 @@ export * from './stat/stat.module'; export * from './page-header/page-header.module'; +export * from './translate/i18n.module'; diff --git a/Frontend Angular 4/src/app/shared/modules/titlecase.module.ts b/Frontend Angular 4/src/app/shared/modules/titlecase.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3a9d95bc46d8f6095ee7fe3e249e16287d2068b --- /dev/null +++ b/Frontend Angular 4/src/app/shared/modules/titlecase.module.ts @@ -0,0 +1,9 @@ +import { NgModule } from '@angular/core'; +import { TitleCasePipe } from '../pipes/titlecase.pipe'; + +@NgModule({ + imports: [], + declarations: [TitleCasePipe], + exports: [TitleCasePipe] +}) +export class TitleCaseModule { } \ No newline at end of file diff --git a/Frontend Angular 4/src/app/shared/modules/translate/i18n.module.ts b/Frontend Angular 4/src/app/shared/modules/translate/i18n.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..8608ce9a359ace9865c01b4a7ae989addb2c46ac --- /dev/null +++ b/Frontend Angular 4/src/app/shared/modules/translate/i18n.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +@NgModule({ + exports: [ + TranslateModule, + ] +}) + +export class I18nModule { } \ No newline at end of file diff --git a/Frontend Angular 4/src/app/shared/pipes/titlecase.pipe.ts b/Frontend Angular 4/src/app/shared/pipes/titlecase.pipe.ts new file mode 100644 index 0000000000000000000000000000000000000000..78abdceb6f557c935f271575114139d0aa079e66 --- /dev/null +++ b/Frontend Angular 4/src/app/shared/pipes/titlecase.pipe.ts @@ -0,0 +1,15 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +/* + * Changes the case of the first letter of a given number of words in a string. +*/ + +@Pipe({ + name: 'titleCase', + pure: false +}) +export class TitleCasePipe implements PipeTransform { + transform(input:string, length: number): string{ + return input.length > 0 ? input.replace(/\w\S*/g, (txt => txt[0].toUpperCase() + txt.substr(1).toLowerCase() )) : ''; + } +} \ No newline at end of file diff --git a/Frontend Angular 4/src/assets/i18n/en.json b/Frontend Angular 4/src/assets/i18n/en.json index b774ac8b3692f40f81524e9e4ff100cd2ca1263a..b17520e99da90e36a4c68c47d5e9ddf78c734b1f 100644 --- a/Frontend Angular 4/src/assets/i18n/en.json +++ b/Frontend Angular 4/src/assets/i18n/en.json @@ -1,3 +1,121 @@ { - "HELLO": "Hello" + "i18n" : { + "action" : { + "login" : "login", + "new" : "new", + "load" : "load", + "reload" : "reload", + "restart" : "restart", + "save" : "save", + "export" : "export", + "zoom" : "zoom", + "center" : "center", + "delete" : "delete", + "download": "download", + "exit" : "exit", + "order": "order", + "edit" : "edit", + "move" : "move", + "share" : "share", + "shared" : "shared", + "created": "created", + "send" : "send", + "sent" : "sent", + "cancel" : "cancel", + "create" : "create", + "goBack" : "go back", + "close" : "close", + "qualify" : "qualify", + "confirm" : "confirm" + }, + "object" : { + "settings" : "settings", + "theme" : "theme", + "name" : "name", + "descr" : "description", + "user" : "user", + "password" : "password", + "guest" : "guest", + "program" : "program", + "figure" : "figure", + "figures" : "figures", + "file" : "file", + "files" : "files", + "group" : "group", + "groups" : "groups", + "interpreter" : "interpreter", + "axis" : "axis", + "axes" : "axes", + "grid" : "grid", + "tip" : "tip", + "normal" : "normal", + "quality" : "quality", + "folder" : "folder", + "here" : "here", + "qualification" : "qualification", + "date" : "date", + "detail" : "detail", + "score" : "score" + }, + "codemirror" : { + "command" : { + "inLine" : "in line", + "column" : "column", + "inColumn" : "In column", + "line" : "line", + "outWarning" : "OUTWarning" + } + }, + "msg" : { + "codemirror" : { + "fontSize" : "Font Size", + "functionWarnings": "Show warnings of use of functions", + "infixOperatorsWarnings" : "Show warnings of use of infix operators", + "cursorPosition" : "Cursor position" + }, + "figure" : { + "multiPlot" : "Multi graph", + "animationSpeed" : "Animation speed" + }, + "file" : { + "fileName" : "File name", + "preview" : "Select a file to preview", + "myFiles" : "My files", + "readOnly": "Read Only", + "viewCalification": "View Calification", + "modified": "Modified file", + "toSend" : "Do you want to send the file {{fileName}}?", + "toSendInfo" : "The file can't be edited after being sent.", + "delete" : "Are you want to delete the {{fileName}} file?", + "seeOriginal" : "See original", + "seeMine" : "See mine", + "share" : "Share "{{fileName}}" with:", + "shared" : "Shared file", + "move" : "Where do you want to move the file?", + "create" : "Where do you want to create the file?", + "qualify" : "Qualify the delivered file", + "evaluated" : "Evaluated file" + }, + "folder" : { + "delete" : "Are you want to delete the {{fileName}} folder?" + }, + "order" : { + "kind" : "Kind", + "date" : "Date" + } + }, + "warning" : { + "file" : { + "noSelected" : "File not selected", + "noPermissionDelete" : "No permissions to delete the file", + "noPermissionMove" : "No permissions to move the file", + "capitalLetter" : "File name must start with upper case.", + "qualifyOutRange" : "Qualification out of range", + "invalidName" : "Invalid file name." + }, + "group" : { + "select" : "Select a group" + } + } + } } \ No newline at end of file diff --git a/Frontend Angular 4/src/assets/i18n/es.json b/Frontend Angular 4/src/assets/i18n/es.json index 9c47392fb38d0bc11654c779ab7e58581d0dafc9..57bab4c88684168a9507744abd2ef1d92cb82245 100644 --- a/Frontend Angular 4/src/assets/i18n/es.json +++ b/Frontend Angular 4/src/assets/i18n/es.json @@ -1,3 +1,121 @@ { - "HELLO" : "Hola" + "i18n" : { + "action" : { + "login" : "iniciar sesión", + "new" : "nuevo", + "load" : "cargar", + "reload" : "recargar", + "restart" : "reiniciar", + "save" : "guardar", + "export" : "exportar", + "zoom" : "zoom", + "center" : "centrar", + "delete" : "borrar", + "download": "descargar", + "exit" : "salir", + "order": "ordenar", + "edit": "editar", + "move": "mover", + "share": "compartir", + "shared" : "compartidos", + "created": "creado", + "send" : "enviar", + "sent" : "enviado", + "cancel" : "cancelar", + "create" : "crear", + "goBack" : "atrás", + "close" : "cerrar", + "qualify" : "calificar", + "confirm" : "confirmar" + }, + "object" : { + "settings" : "configuración", + "name" : "nombre", + "descr" : "descripción", + "user" : "usuario", + "theme" : "tema", + "password" : "contraseña", + "guest" : "invitado", + "program" : "programa", + "figure" : "figura", + "figures" : "figuras", + "file" : "archivo", + "files" : "archivos", + "group" : "grupo", + "groups" : "grupos", + "interpreter" : "intérprete", + "axis" : "eje", + "axes" : "ejes", + "grid" : "grilla", + "tip" : "tip", + "normal" : "normal", + "quality" : "calidad", + "folder" : "carpeta", + "here" : "aquÃ", + "qualification" : "calificación", + "date" : "fecha", + "detail" : "detalle", + "score" : "puntaje" + }, + "codemirror" : { + "command" : { + "inLine" : "en lÃnea", + "column" : "columna", + "inColumn" : "En columna", + "line" : "lÃnea", + "outWarning" : "OUTAdvertencia" + } + }, + "msg" : { + "codemirror" : { + "fontSize" : "Tamaño de fuente", + "functionWarnings": "Mostrar advertencias de uso de funciones", + "infixOperatorsWarnings" : "Mostrar advertencias de uso de operadores infijos", + "cursorPosition" : "Posición del cursor" + }, + "figure" : { + "multiPlot" : "Multi gráfica", + "animationSpeed" : "Velocidad de animación" + }, + "file" : { + "fileName" : "Nombre de archivo", + "preview" : "Seleccione un archivo para previsualizarlo", + "myFiles" : "Mis archivos", + "readOnly": "Sólo lectura", + "viewCalification": "Ver Calificación", + "modified": "Archivo modificado", + "toSend" : "¿Desea enviar el archivo {{fileName}}?", + "toSendInfo" : "No se podrá editar luego de enviado.", + "delete" : "¿Está seguro que desea eliminar el archivo {{fileName}}?", + "seeOriginal" : "Ver original", + "seeMine" : "Ver mio", + "share" : "Compartir "{{fileName}}" con:", + "shared" : "Archivo compartido", + "move" : "¿Dónde quieres mover el archivo?", + "create" : "¿Dónde quieres crear el archivo?", + "qualify" : "Calificar entrega", + "evaluated" : "Archivo evaluado" + }, + "folder" : { + "delete" : "¿Está seguro que desea eliminar la carpeta {{fileName}}?" + }, + "order" : { + "kind" : "Tipo", + "date" : "Fecha" + } + }, + "warning" : { + "file" : { + "noSelected" : "Archivo no seleccionado", + "noPermissionDelete" : "Sin permisos para eliminar el archivo", + "noPermissionMove" : "Sin permisos para mover el archivo", + "capitalLetter" : "Nombre de archivo debe iniciar con mayúscula.", + "qualifyOutRange" : "Calificación fuera de rango", + "invalidName" : "Nombre de archivo inválido." + }, + "group" : { + "select" : "Seleccione un grupo" + } + } + } } \ No newline at end of file diff --git a/Servidor JEE/pom.xml b/Servidor JEE/pom.xml index 5d04865f82100387f838d0ea7108732c38da3bb9..0d85609bf94b68bf5065155c0477b863936130b2 100644 --- a/Servidor JEE/pom.xml +++ b/Servidor JEE/pom.xml @@ -47,11 +47,10 @@ <version>2.9.0</version> </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.0</version> - </dependency> - + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <version>1.4</version> + </dependency> </dependencies> <build> diff --git a/Servidor JEE/src/main/java/edu/proygrado/ejb/CommandsBean.java b/Servidor JEE/src/main/java/edu/proygrado/ejb/CommandsBean.java index a944abd6209876f2279b507ab60353154046185e..ae467daf346c41c7450fae9b6afc8886666a72f9 100644 --- a/Servidor JEE/src/main/java/edu/proygrado/ejb/CommandsBean.java +++ b/Servidor JEE/src/main/java/edu/proygrado/ejb/CommandsBean.java @@ -203,6 +203,7 @@ public class CommandsBean { this.proceso.destroy(); } + String fullPathBinarios = context.getRealPath("/WEB-INF/classes/edu/proygrado/binarios"); String fullPathMatefun = context.getRealPath("/WEB-INF/classes/edu/proygrado/binarios/MateFun"); String fullPathMatefunTmp = context.getRealPath("/WEB-INF/classes/edu/proygrado/binarios/MateFunTmp")+"/"; @@ -225,7 +226,7 @@ public class CommandsBean { } if (this.i18n == null) { - this.i18n = this.i18nEJB.getLanguage(context.getRealPath("/WEB-INF/classes/edu/proygrado/binarios/i18n"), userLang); + this.i18n = this.i18nEJB.getLanguage(context.getRealPath("/WEB-INF/classes/edu/proygrado/binarios/internationalization"), userLang); } if (config != null && config.isArgumentoI() && config.isArgumentoF()) { @@ -247,6 +248,8 @@ public class CommandsBean { } this.latch = new CountDownLatch(2); + + this.builder.directory(new File(fullPathBinarios)); Map<String, String> envs = this.builder.environment();