Skip to content
Snippets Groups Projects
Commit 1a4082eb authored by ncamera's avatar ncamera
Browse files

Arreglar traducciones en graph3D

parent bcddb9ed
No related branches found
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
......@@ -7,7 +7,8 @@
style="min-width: 70px"
(click)="changeZoomType()"
>
{{ getZoom3DTypeName(graphProps.zoomType) }}
{{ translationTypes[graphProps.zoomType] | translate | titleCase
}}{{ translationTypesSuffix[graphProps.zoomType] }}
</button>
<div
class="btn-group"
......@@ -26,7 +27,8 @@
[disabled]="type === graphProps.zoomType"
(click)="changeZoomType(type)"
>
{{ getZoom3DTypeName(type) }}
{{ translationTypes[type] | translate | titleCase
}}{{ translationTypesSuffix[type] }}
</button>
</div>
</div>
......
......@@ -30,19 +30,29 @@ import { TitleCasePipe } from "../../../shared/pipes/titlecase.pipe";
export class Graph3DComponent implements AfterViewInit {
private ghciServiceSub: any;
private translateService: any;
private titlecasePipe: any;
translateService: any;
titlecasePipe: any;
/**
* Diccionario de traducciones para los tipos de Zoom.
*/
private translationTypes = {
translationTypes = {
[Zoom3DType.Normal]: "i18n.object.normal",
[Zoom3DType.XAxis]: "i18n.object.axis",
[Zoom3DType.YAxis]: "i18n.object.axis",
[Zoom3DType.ZAxis]: "i18n.object.axis",
};
/**
* Diccionario para complementar las traducciones de los tipos de Zoom.
*/
translationTypesSuffix = {
[Zoom3DType.Normal]: "",
[Zoom3DType.XAxis]: " X",
[Zoom3DType.YAxis]: " Y",
[Zoom3DType.ZAxis]: " Z",
};
@ViewChild("graph3DElement", { static: true })
private graph3DRef: ElementRef;
......@@ -206,22 +216,4 @@ export class Graph3DComponent implements AfterViewInit {
graph3DLib.reset();
};
public getZoom3DTypeName = (type: Zoom3DType) => {
let translation: string;
this.translateService.get(this.translationTypes[type]).subscribe((res) => {
translation = res;
});
if (type == 2) {
translation += " x";
} else if (type == 3) {
translation += " y";
} else if (type == 4) {
translation += " z";
}
return this.titlecasePipe.transform(translation);
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment