adding translations 1/2

UI Translations

Coming in 2/2: Output translations
This commit is contained in:
SinusFox
2024-10-10 15:08:59 +02:00
parent 6e174688bd
commit d4c1c3a2ad
7 changed files with 433 additions and 36 deletions
+11 -2
View File
@@ -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 + "<br>"; // Append message