Skip to content
Snippets Groups Projects
Commit 839cfd97 authored by ncamera's avatar ncamera
Browse files

Arreglar traducciones en CodeMirror

parent 4a831415
No related branches found
No related tags found
1 merge request!1Se actualiza Angular a la versión 13 y se resuelven vulnerabilidades
......@@ -428,10 +428,12 @@ export class ArchivosComponent {
this.haskellService
.editarArchivo(this.archivoSeleccionado.id, this.archivoSeleccionado)
.subscribe(
(archivo) => {
console.log(
this.translateService.get("i18n.msg.file.modified").value
);
() => {
this.translateService
.get("i18n.msg.file.modified")
.subscribe((res) => {
console.log(res);
});
},
(error) => {
this.notifService.error(error);
......
......@@ -280,6 +280,12 @@ export class GHCIService {
const language = this.authService.getLanguage();
const traduccionColumna = language == "es" ? "columna" : "column";
const traduccionEnColumna = language == "es" ? "En columna" : "In column";
const traduccionOutWarning =
language == "es" ? "OUTAdvertencia" : "OUTWarning";
const traduccionConsoleWarnings =
language == "es"
? "El programa contiene advertencias"
: "Program contains warnings";
if (this.warningStepReaded === 1) {
try {
......@@ -322,58 +328,47 @@ export class GHCIService {
}
if (this.warningStepReaded === 0) {
try {
var file = m.resultado
.split(
`${
this.translateService.get("i18n.codemirror.command.outWarning")
.value
}:`
)[1]
.trim()
.split(`${this.translateService.get("i18n.object.file").value}:`)[1]
.split(" ")[1];
// retrive line of warning
var line =
m.resultado
.split(
`${
this.translateService.get("i18n.codemirror.command.outWarning")
.value
}:`
)[1]
.trim()
.split(
`${
this.translateService.get("i18n.codemirror.command.line").value
}:`
)[1]
.split(" ")[1] - 1;
this.lastWarning = line;
this.lastWarningFile = file;
this.warnings.push(line);
var warningText = m.resultado
.split(
`${
this.translateService.get("i18n.codemirror.command.outWarning")
.value
}:`
)[1]
.trim();
this.warningStepReaded = 1;
this.warningText = warningText;
if (this.waitingForWarning) {
this.outputConsole(
`${
this.translateService.get("i18n.msg.codemirror.consoleWarnings")
.value
}\n`
);
this.waitingForWarning = false;
}
} catch (err) {}
// Se obtiene la traducción de file
this.translateService
.get("i18n.object.file")
.subscribe((traduccionFile) => {
try {
const file = m.resultado
.split(`${traduccionOutWarning}:`)[1]
.trim()
.split(`${traduccionFile}:`)[1]
.split(" ")[1];
// Se obtiene la traducción de line
this.translateService
.get("i18n.codemirror.command.line")
.subscribe((traduccionLine) => {
// retrive line of warning
const line =
m.resultado
.split(`${traduccionOutWarning}:`)[1]
.trim()
.split(`${traduccionLine}:`)[1]
.split(" ")[1] - 1;
this.lastWarning = line;
this.lastWarningFile = file;
this.warnings.push(line);
const warningText = m.resultado
.split(`${traduccionOutWarning}:`)[1]
.trim();
this.warningStepReaded = 1;
this.warningText = warningText;
if (this.waitingForWarning) {
this.outputConsole(`${traduccionConsoleWarnings}\n`);
this.waitingForWarning = false;
}
});
} catch (err) {}
});
}
}
......
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