) => {
+ setLanguage(event.target.value);
+ };
+
return (
<>
=.\nExample:\nx + y\n-786433 x1 + 655361 x2"}
- id="objective"/>
+ title={tr_boxObjTitle}
+ placeholder={tr_boxObjDesc}
+ id="objective" />
=.\nExample:\n+1 x + 2 y <= 15\n524321 x14 + 524305 x15 <= 4194303.5"}
- id="subject"/>
+ title={tr_boxSubjTitle}
+ placeholder={tr_boxSubjDesc}
+ id="subject" />
=.\nExample:\nx >= 0\nx > 0\n0 <= x1 <= 1"}
- id="bounds"/>
+ title={tr_boxBoundsTitle}
+ placeholder={tr_boxBoundsDesc}
+ id="bounds" />
- {/* */}
- {/* */}
-
+ text={tr_boxOut} />
>
);
}
diff --git a/src/app/scripts.ts b/src/app/scripts.ts
index 161b551..144adcd 100644
--- a/src/app/scripts.ts
+++ b/src/app/scripts.ts
@@ -5,13 +5,22 @@ import * as LPAPI from "../api/optimizeLP.js"
import * as GLPKAPI from "../solver/glpk.min.js"
import { start } from "repl";
+import text from "./lang"
+
// custom log so we can append the output dynamically
-function customLog(message: string) {
- console.log(message); // Continue to print message inside of box
+function customLog(input: string) {
+
+
+ // get language
+ const lang = (document.getElementById('language_current') as HTMLSelectElement)?.value;
// Get Output Box
const outputElement = document.getElementById('out');
+ // load text
+ const message: string = text(lang, input);
+ console.log(message); // Continue to print message inside of box
+
// Append message if element exists
if (outputElement) {
outputElement.innerHTML += message + "
"; // Append message