Skip to content
Snippets Groups Projects
Commit c9681047 authored by Diego Rey's avatar Diego Rey
Browse files

Add translations language for graph2D component

parent f1ee0147
Branches
Tags
No related merge requests found
<!-- Buttons Controls --> <!-- Buttons Controls -->
<div class="buttons-control"> <div class="buttons-control">
<button ngbPopover="Zoom +" <button ngbPopover='{{ "i18n.action.zoom" | translate | titleCase }} +'
class="btn btn-sm btn-secondary btn-zoom-increase" class="btn btn-sm btn-secondary btn-zoom-increase"
data-placement="bottom" data-placement="bottom"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
(click)=zoomIn() > (click)=zoomIn() >
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
</button> </button>
<button ngbPopover="Zoom -" <button ngbPopover='{{ "i18n.action.zoom" | translate | titleCase }} -'
class="btn btn-sm btn-secondary btn-zoom-decrease" class="btn btn-sm btn-secondary btn-zoom-decrease"
data-placement="bottom" data-placement="bottom"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
(click)=zoomOut() > (click)=zoomOut() >
<i class="fa fa-minus"></i> <i class="fa fa-minus"></i>
</button> </button>
<button ngbPopover="Centrar" <button ngbPopover='{{ "i18n.action.center" | translate | titleCase }}'
class="btn btn-sm btn-secondary btn-zoom-center" class="btn btn-sm btn-secondary btn-zoom-center"
data-placement="bottom" data-placement="bottom"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
(click)="recenterPlot()" > (click)="recenterPlot()" >
<i class="fa fa-arrows"></i> <i class="fa fa-arrows"></i>
</button> </button>
<button ngbPopover="Borrar" <button ngbPopover='{{ "i18n.action.delete" | translate | titleCase }}'
class="btn btn-sm btn-secondary btn-trash" class="btn btn-sm btn-secondary btn-trash"
data-placement="bottom" data-placement="bottom"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
(click)="cleanPlot()" > (click)="cleanPlot()" >
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</button> </button>
<button ngbPopover="Descargar PNG" <button ngbPopover='{{ "i18n.action.download" | translate | titleCase }} PNG'
class="btn btn-sm btn-secondary btn-download" class="btn btn-sm btn-secondary btn-download"
data-placement="bottom" data-placement="bottom"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
placement="bottom" placement="bottom"
closePopoverDirective closePopoverDirective
[ngbPopover]=popoverCanvas [ngbPopover]=popoverCanvas
popoverTitle="Configuración" popoverTitle='{{ "i18n.object.settings" | translate | titleCase }}'
#popover="ngbPopover" #popover="ngbPopover"
tiggers="click"> tiggers="click">
<i class="fa fa-gear"></i> <i class="fa fa-gear"></i>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
class="form-control form-control-sm" class="form-control form-control-sm"
[checked]= settings.grid [checked]= settings.grid
(click)="toggleGrid()"> (click)="toggleGrid()">
Grilla {{ "i18n.object.grid" | translate | titleCase }}
</label> </label>
<label> <label>
<input <input
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
class="form-control form-control-sm" class="form-control form-control-sm"
[checked]= settings.axis [checked]= settings.axis
(click)="toggleAxis()"> (click)="toggleAxis()">
Ejes {{ "i18n.object.axes" | translate | titleCase }}
</label> </label>
<label> <label>
<input <input
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
class="form-control form-control-sm" class="form-control form-control-sm"
[checked]= settings.tip [checked]= settings.tip
(click)="toggleTip()"> (click)="toggleTip()">
Tip {{ "i18n.object.tip" | translate | titleCase }}
</label> </label>
<label [class.disabled]="funciones.length === 0"> <label [class.disabled]="funciones.length === 0">
<input <input
...@@ -91,14 +91,14 @@ ...@@ -91,14 +91,14 @@
[attr.disabled]="funciones.length === 0 ? '' : null" [attr.disabled]="funciones.length === 0 ? '' : null"
[checked]=animation.boton [checked]=animation.boton
(click)="multiGraf(value)"> (click)="multiGraf(value)">
Multi gráfica {{ "i18n.msg.figure.multiPlot" | translate | titleCase }}
</label> </label>
</div> </div>
<hr> <hr>
<div class="zoom-control setting-section"> <div class="zoom-control setting-section">
<div [class.disabled]="funciones.length === 0" style="display: flex;"> <div [class.disabled]="funciones.length === 0" style="display: flex;">
<span style="margin-right: 8px; align-self: center;"> <span style="margin-right: 8px; align-self: center;">
Zoom {{ "i18n.action.zoom" | translate | titleCase }}
</span> </span>
<input <input
type="number" type="number"
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<hr> <hr>
<div class="animation-controls setting-section" <div class="animation-controls setting-section"
[class.disabled]="animation.data.length === 0"> [class.disabled]="animation.data.length === 0">
<label>Velocidad de animación:</label> <label>{{ "i18n.msg.figure.animationSpeed" | translate }}:</label>
<div> <div>
<button class="btn btn-sm btn-secondary" <button class="btn btn-sm btn-secondary"
[attr.disabled]="animation.data.length === 0 ? '' : null" [attr.disabled]="animation.data.length === 0 ? '' : null"
......
...@@ -2,6 +2,7 @@ import { Component, ViewChild, ElementRef } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { Component, ViewChild, ElementRef } from '@angular/core';
import { GHCIService } from '../../../shared/services/ghci.service'; import { GHCIService } from '../../../shared/services/ghci.service';
import functionPlot from 'function-plot'; import functionPlot from 'function-plot';
import { Animation, Setting, toJSON, triggerDownload } from './graph2D.helper'; import { Animation, Setting, toJSON, triggerDownload } from './graph2D.helper';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
...@@ -66,7 +67,7 @@ export class Graph2DComponent { ...@@ -66,7 +67,7 @@ export class Graph2DComponent {
public multiGraf = () => { public multiGraf = () => {
this.animation.boton = !this.animation.boton; this.animation.boton = !this.animation.boton;
} }
public constructor(private ghciService: GHCIService) { public constructor(private ghciService: GHCIService, public translate: TranslateService) {
this.ghciServiceSub = ghciService.messages.subscribe( this.ghciServiceSub = ghciService.messages.subscribe(
canvas => { canvas => {
// Stop Animation // Stop Animation
......
...@@ -5,9 +5,19 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; ...@@ -5,9 +5,19 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { Graph2DComponent } from './graph2D.component'; import { Graph2DComponent } from './graph2D.component';
import { DirectivesModule } from '../../../shared/directives/directives.module'; import { DirectivesModule } from '../../../shared/directives/directives.module';
import { I18nModule } from '../../../shared/modules/translate/i18n.module';
import { TitleCaseModule } from '../../../shared/modules/titlecase.module';
@NgModule({ @NgModule({
imports: [FormsModule, RouterModule, CommonModule, NgbModule, DirectivesModule], imports: [
FormsModule,
RouterModule,
CommonModule,
NgbModule,
DirectivesModule,
I18nModule,
TitleCaseModule
],
declarations: [Graph2DComponent], declarations: [Graph2DComponent],
exports: [Graph2DComponent], exports: [Graph2DComponent],
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment