Commit a1bbaef4 authored by Diego Rey's avatar Diego Rey
Browse files

Add translations language for layout component

parent 3bbc2af3
......@@ -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']);
......
......@@ -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]
})
......
......@@ -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>
......
<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>&nbsp;Programa
<i class="fa fa-fw fa-desktop"></i>&nbsp;{{ "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>&nbsp;Archivos
<i class="fa fa-fw fa-file-o"></i>&nbsp;{{ "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>&nbsp;Grupos
<i class="fa fa-fw fa-users"></i>&nbsp;{{ "i18n.object.groups" | translate | titleCase }}
</a>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment