Skip to content
Snippets Groups Projects
Commit dfbd92e7 authored by Nicolas Camera's avatar Nicolas Camera
Browse files

Se arreglan las traducciones del graficador 3D

parent a84271e1
No related branches found
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
...@@ -4,18 +4,28 @@ ...@@ -4,18 +4,28 @@
<button <button
type="button" type="button"
class="btn btn-secondary" class="btn btn-secondary"
style="min-width: 70px;" style="min-width: 70px"
(click)=changeZoomType()> (click)="changeZoomType()"
>
{{ getZoom3DTypeName(graphProps.zoomType) }} {{ getZoom3DTypeName(graphProps.zoomType) }}
</button> </button>
<div class="btn-group" ngbDropdown role="group" aria-label="Button group with nested dropdown"> <div
<button class="btn btn-secondary dropdown-toggle-split" ngbDropdownToggle></button> class="btn-group"
ngbDropdown
role="group"
aria-label="Button group with nested dropdown"
>
<button
class="btn btn-secondary dropdown-toggle-split"
ngbDropdownToggle
></button>
<div class="dropdown-menu" ngbDropdownMenu> <div class="dropdown-menu" ngbDropdownMenu>
<button <button
*ngFor="let type of [1, 2, 3, 4]" *ngFor="let type of [1, 2, 3, 4]"
class="dropdown-item" class="dropdown-item"
[disabled]="type === graphProps.zoomType" [disabled]="type === graphProps.zoomType"
(click)=changeZoomType(type)> (click)="changeZoomType(type)"
>
{{ getZoom3DTypeName(type) }} {{ getZoom3DTypeName(type) }}
</button> </button>
</div> </div>
...@@ -23,29 +33,32 @@ ...@@ -23,29 +33,32 @@
</div> </div>
<button <button
ngbPopover='{{ "i18n.action.zoom" | translate | titleCase}} +' ngbPopover="{{ 'i18n.action.zoom' | translate | titleCase }} +"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
data-placement="bottom" data-placement="bottom"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
(click)=zoomIn() > (click)="zoomIn()"
>
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
</button> </button>
<button <button
ngbPopover='{{ "i18n.action.zoom" | translate | titleCase}} -' ngbPopover="{{ 'i18n.action.zoom' | translate | titleCase }} -"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
data-placement="bottom" data-placement="bottom"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
(click)=zoomOut() > (click)="zoomOut()"
>
<i class="fa fa-minus"></i> <i class="fa fa-minus"></i>
</button> </button>
<button <button
ngbPopover='{{ "i18n.action.center" | translate | titleCase}}' ngbPopover="{{ 'i18n.action.center' | translate | titleCase }}"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
data-placement="bottom" data-placement="bottom"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
(click)=center() > (click)="center()"
>
<i class="fa fa-arrows"></i> <i class="fa fa-arrows"></i>
</button> </button>
...@@ -53,10 +66,11 @@ ...@@ -53,10 +66,11 @@
closePopoverDirective closePopoverDirective
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
placement="bottom" placement="bottom"
[ngbPopover]=popoverAxesSize [ngbPopover]="popoverAxesSize"
popoverTitle="Rango de ejes" popoverTitle="Rango de ejes"
#popover="ngbPopover" #popover="ngbPopover"
tiggers="click"> tiggers="click"
>
<i class="fa fa-arrows-h"></i> <i class="fa fa-arrows-h"></i>
</button> </button>
<ng-template #popoverAxesSize> <ng-template #popoverAxesSize>
...@@ -70,9 +84,7 @@ ...@@ -70,9 +84,7 @@
[min]="-99" [min]="-99"
(change)="onChangeAxesSize('xMin', $event)" (change)="onChangeAxesSize('xMin', $event)"
/> />
<div class="less-than"> <div class="less-than"><span>&#8804;</span>x<span>&#8804;</span></div>
<span>&#8804;</span>x<span>&#8804;</span>
</div>
<input <input
type="number" type="number"
...@@ -93,9 +105,7 @@ ...@@ -93,9 +105,7 @@
[min]="-99" [min]="-99"
(change)="onChangeAxesSize('yMin', $event)" (change)="onChangeAxesSize('yMin', $event)"
/> />
<div class="less-than"> <div class="less-than"><span>&#8804;</span>y<span>&#8804;</span></div>
<span>&#8804;</span>y<span>&#8804;</span>
</div>
<input <input
type="number" type="number"
...@@ -116,9 +126,7 @@ ...@@ -116,9 +126,7 @@
[min]="-99" [min]="-99"
(change)="onChangeAxesSize('zMin', $event)" (change)="onChangeAxesSize('zMin', $event)"
/> />
<div class="less-than"> <div class="less-than"><span>&#8804;</span>z<span>&#8804;</span></div>
<span>&#8804;</span>z<span>&#8804;</span>
</div>
<input <input
type="number" type="number"
...@@ -132,36 +140,40 @@ ...@@ -132,36 +140,40 @@
</div> </div>
</ng-template> </ng-template>
<button <button
ngbPopover='{{ "i18n.action.delete" | translate | titleCase }}' ngbPopover="{{ 'i18n.action.delete' | translate | titleCase }}"
triggers="mouseenter:mouseleave" triggers="mouseenter:mouseleave"
data-placement="bottom" data-placement="bottom"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
(click)=clear() > (click)="clear()"
>
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</button> </button>
<button <button
[ngbPopover]=popoverConfig [ngbPopover]="popoverConfig"
closePopoverDirective closePopoverDirective
placement="bottom" placement="bottom"
tiggers="click" tiggers="click"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
popoverTitle='{{ "i18n.object.settings" | translate | titleCase }}' popoverTitle="{{ 'i18n.object.settings' | translate | titleCase }}"
> >
<i class="fa fa-gear"></i> <i class="fa fa-gear"></i>
</button> </button>
<ng-template #popoverConfig> <ng-template #popoverConfig>
<div style="width: 140px;"> <div style="width: 140px">
<label class="d-block"> <label class="d-block">
<input type="checkbox"[checked]=graphProps.showAxes (click)="changeAxesVisibility()"> <input
type="checkbox"
[checked]="graphProps.showAxes"
(click)="changeAxesVisibility()"
/>
{{ "i18n.object.grid" | translate | titleCase }} {{ "i18n.object.grid" | translate | titleCase }}
</label> </label>
<div style="display: flex;"> <div style="display: flex">
<span style="margin-right: 8px; align-self: center;"> <span style="margin-right: 8px; align-self: center">
{{ "i18n.object.quality" | translate | titleCase }}: {{ "i18n.object.quality" | translate | titleCase }}:
</span> </span>
...@@ -172,13 +184,11 @@ ...@@ -172,13 +184,11 @@
[max]="99" [max]="99"
[min]="2" [min]="2"
(change)="onChangeQuality()" (change)="onChangeQuality()"
style="width: 55px;" style="width: 55px"
/> />
</div> </div>
</div> </div>
</ng-template> </ng-template>
</div> </div>
<div class="card-block contenedor-canvas"> <div class="card-block contenedor-canvas">
...@@ -193,8 +203,6 @@ ...@@ -193,8 +203,6 @@
> >
</animation-control> </animation-control>
<div #graph3DElement style="width: 100%; height: 100%;"> <div #graph3DElement style="width: 100%; height: 100%"></div>
</div> </div>
</div> </div>
</div>
...@@ -33,6 +33,16 @@ export class Graph3DComponent implements AfterViewInit { ...@@ -33,6 +33,16 @@ export class Graph3DComponent implements AfterViewInit {
private translateService: any; private translateService: any;
private titlecasePipe: any; private titlecasePipe: any;
/**
* Diccionario de traducciones para los tipos de Zoom.
*/
private translationTypes = {
[Zoom3DType.Normal]: "i18n.object.normal",
[Zoom3DType.XAxis]: "i18n.object.axis",
[Zoom3DType.YAxis]: "i18n.object.axis",
[Zoom3DType.ZAxis]: "i18n.object.axis",
};
@ViewChild("graph3DElement", { static: true }) @ViewChild("graph3DElement", { static: true })
private graph3DRef: ElementRef; private graph3DRef: ElementRef;
...@@ -198,29 +208,20 @@ export class Graph3DComponent implements AfterViewInit { ...@@ -198,29 +208,20 @@ export class Graph3DComponent implements AfterViewInit {
}; };
public getZoom3DTypeName = (type: Zoom3DType) => { public getZoom3DTypeName = (type: Zoom3DType) => {
switch (type) { let translation: string;
case Zoom3DType.Normal:
return this.titlecasePipe.transform( this.translateService.get(this.translationTypes[type]).subscribe((res) => {
this.translateService.get("i18n.object.normal").value translation = res;
); });
case Zoom3DType.XAxis:
return ( if (type == 2) {
this.titlecasePipe.transform( translation += " x";
this.translateService.get("i18n.object.axis").value } else if (type == 3) {
) + " x" translation += " y";
); } else if (type == 4) {
case Zoom3DType.YAxis: translation += " z";
return (
this.titlecasePipe.transform(
this.translateService.get("i18n.object.axis").value
) + " y"
);
case Zoom3DType.ZAxis:
return (
this.titlecasePipe.transform(
this.translateService.get("i18n.object.axis").value
) + " z"
);
} }
return this.titlecasePipe.transform(translation);
}; };
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment