adding translations 1/2
UI Translations Coming in 2/2: Output translations
This commit is contained in:
+11
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user