ändern der Praxissoftware in deutsch und Spanisch
This commit is contained in:
parent
81473882e5
commit
10e83f53da
52
app.js
52
app.js
@ -4,6 +4,8 @@ const express = require("express");
|
|||||||
const session = require("express-session");
|
const session = require("express-session");
|
||||||
const helmet = require("helmet");
|
const helmet = require("helmet");
|
||||||
const mysql = require("mysql2/promise");
|
const mysql = require("mysql2/promise");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
// ✅ Verschlüsselte Config
|
// ✅ Verschlüsselte Config
|
||||||
const { configExists, saveConfig } = require("./config-manager");
|
const { configExists, saveConfig } = require("./config-manager");
|
||||||
@ -97,6 +99,19 @@ app.use(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ✅ i18n Middleware
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
const lang = req.session.lang || "de"; // Standard DE
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, "locales", `${lang}.json`);
|
||||||
|
const raw = fs.readFileSync(filePath, "utf-8");
|
||||||
|
|
||||||
|
res.locals.t = JSON.parse(raw); // t = translations
|
||||||
|
res.locals.lang = lang;
|
||||||
|
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
const flashMiddleware = require("./middleware/flash.middleware");
|
const flashMiddleware = require("./middleware/flash.middleware");
|
||||||
app.use(flashMiddleware);
|
app.use(flashMiddleware);
|
||||||
|
|
||||||
@ -166,6 +181,43 @@ app.use((req, res, next) => {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Sprachen Route
|
||||||
|
// ✅ i18n Middleware (Sprache pro Benutzer über Session)
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
const lang = req.session.lang || "de"; // Standard: Deutsch
|
||||||
|
|
||||||
|
let translations = {};
|
||||||
|
try {
|
||||||
|
const filePath = path.join(__dirname, "locales", `${lang}.json`);
|
||||||
|
translations = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
||||||
|
} catch (err) {
|
||||||
|
console.error("❌ i18n Fehler:", err.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ In EJS verfügbar machen
|
||||||
|
res.locals.t = translations;
|
||||||
|
res.locals.lang = lang;
|
||||||
|
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/lang/:lang", (req, res) => {
|
||||||
|
const newLang = req.params.lang;
|
||||||
|
|
||||||
|
if (!["de", "es"].includes(newLang)) {
|
||||||
|
return res.redirect(req.get("Referrer") || "/dashboard");
|
||||||
|
}
|
||||||
|
|
||||||
|
req.session.lang = newLang;
|
||||||
|
|
||||||
|
// ✅ WICHTIG: Session speichern bevor redirect
|
||||||
|
req.session.save((err) => {
|
||||||
|
if (err) console.error("❌ Session save error:", err);
|
||||||
|
|
||||||
|
return res.redirect(req.get("Referrer") || "/dashboard");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/* ===============================
|
/* ===============================
|
||||||
DEINE LOGIK (unverändert)
|
DEINE LOGIK (unverändert)
|
||||||
================================ */
|
================================ */
|
||||||
|
|||||||
0
backups/praxissoftware_2026-01-18_13-36-29.sql
Normal file
0
backups/praxissoftware_2026-01-18_13-36-29.sql
Normal file
0
backups/praxissoftware_2026-01-18_13-40-33.sql
Normal file
0
backups/praxissoftware_2026-01-18_13-40-33.sql
Normal file
0
backups/praxissoftware_2026-01-18_13-45-35.sql
Normal file
0
backups/praxissoftware_2026-01-18_13-45-35.sql
Normal file
610
backups/praxissoftware_2026-01-18_13-53-09.sql
Normal file
610
backups/praxissoftware_2026-01-18_13-53-09.sql
Normal file
File diff suppressed because one or more lines are too long
610
backups/praxissoftware_2026-01-18_13-58-30.sql
Normal file
610
backups/praxissoftware_2026-01-18_13-58-30.sql
Normal file
File diff suppressed because one or more lines are too long
610
backups/praxissoftware_2026-01-18_13-59-02.sql
Normal file
610
backups/praxissoftware_2026-01-18_13-59-02.sql
Normal file
File diff suppressed because one or more lines are too long
610
backups/praxissoftware_2026-01-18_14-06-52.sql
Normal file
610
backups/praxissoftware_2026-01-18_14-06-52.sql
Normal file
File diff suppressed because one or more lines are too long
BIN
libmysql.dll
Normal file
BIN
libmysql.dll
Normal file
Binary file not shown.
26
locales/de.json
Normal file
26
locales/de.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"global": {
|
||||||
|
"save": "Speichern",
|
||||||
|
"cancel": "Abbrechen",
|
||||||
|
"search": "Suchen",
|
||||||
|
"reset": "Reset",
|
||||||
|
"dashboard": "Dashboard"
|
||||||
|
},
|
||||||
|
"sidebar": {
|
||||||
|
"patients": "Patienten",
|
||||||
|
"medications": "Medikamente",
|
||||||
|
"servicesOpen": "Offene Leistungen",
|
||||||
|
"billing": "Abrechnung",
|
||||||
|
"admin": "Verwaltung",
|
||||||
|
"logout": "Logout"
|
||||||
|
},
|
||||||
|
"dashboard": {
|
||||||
|
"welcome": "Willkommen",
|
||||||
|
"waitingRoom": "Wartezimmer-Monitor",
|
||||||
|
"noWaitingPatients": "Keine Patienten im Wartezimmer."
|
||||||
|
},
|
||||||
|
"adminSidebar": {
|
||||||
|
"users": "Userverwaltung",
|
||||||
|
"database": "Datenbankverwaltung"
|
||||||
|
}
|
||||||
|
}
|
||||||
27
locales/es.json
Normal file
27
locales/es.json
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"global": {
|
||||||
|
"save": "Guardar",
|
||||||
|
"cancel": "Cancelar",
|
||||||
|
"search": "Buscar",
|
||||||
|
"reset": "Resetear",
|
||||||
|
"dashboard": "Panel"
|
||||||
|
},
|
||||||
|
"sidebar": {
|
||||||
|
"patients": "Pacientes",
|
||||||
|
"medications": "Medicamentos",
|
||||||
|
"servicesOpen": "Servicios abiertos",
|
||||||
|
"billing": "Facturación",
|
||||||
|
"admin": "Administración",
|
||||||
|
"logout": "Cerrar sesión"
|
||||||
|
},
|
||||||
|
"dashboard": {
|
||||||
|
"welcome": "Bienvenido",
|
||||||
|
"waitingRoom": "Monitor sala de espera",
|
||||||
|
"noWaitingPatients": "No hay pacientes en la sala de espera."
|
||||||
|
},
|
||||||
|
|
||||||
|
"adminSidebar": {
|
||||||
|
"users": "Administración de usuarios",
|
||||||
|
"database": "Administración de base de datos"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
mysqldump.exe
Normal file
BIN
mysqldump.exe
Normal file
Binary file not shown.
BIN
plugin/adt_null.dll
Normal file
BIN
plugin/adt_null.dll
Normal file
Binary file not shown.
BIN
plugin/authentication_kerberos_client.dll
Normal file
BIN
plugin/authentication_kerberos_client.dll
Normal file
Binary file not shown.
BIN
plugin/authentication_ldap_sasl_client.dll
Normal file
BIN
plugin/authentication_ldap_sasl_client.dll
Normal file
Binary file not shown.
BIN
plugin/authentication_oci_client.dll
Normal file
BIN
plugin/authentication_oci_client.dll
Normal file
Binary file not shown.
BIN
plugin/authentication_openid_connect_client.dll
Normal file
BIN
plugin/authentication_openid_connect_client.dll
Normal file
Binary file not shown.
BIN
plugin/authentication_webauthn_client.dll
Normal file
BIN
plugin/authentication_webauthn_client.dll
Normal file
Binary file not shown.
BIN
plugin/component_audit_api_message_emit.dll
Normal file
BIN
plugin/component_audit_api_message_emit.dll
Normal file
Binary file not shown.
BIN
plugin/component_connection_control.dll
Normal file
BIN
plugin/component_connection_control.dll
Normal file
Binary file not shown.
BIN
plugin/component_keyring_file.dll
Normal file
BIN
plugin/component_keyring_file.dll
Normal file
Binary file not shown.
BIN
plugin/component_log_filter_dragnet.dll
Normal file
BIN
plugin/component_log_filter_dragnet.dll
Normal file
Binary file not shown.
BIN
plugin/component_log_sink_json.dll
Normal file
BIN
plugin/component_log_sink_json.dll
Normal file
Binary file not shown.
BIN
plugin/component_log_sink_syseventlog.dll
Normal file
BIN
plugin/component_log_sink_syseventlog.dll
Normal file
Binary file not shown.
BIN
plugin/component_mysqlbackup.dll
Normal file
BIN
plugin/component_mysqlbackup.dll
Normal file
Binary file not shown.
BIN
plugin/component_query_attributes.dll
Normal file
BIN
plugin/component_query_attributes.dll
Normal file
Binary file not shown.
BIN
plugin/component_reference_cache.dll
Normal file
BIN
plugin/component_reference_cache.dll
Normal file
Binary file not shown.
BIN
plugin/component_validate_password.dll
Normal file
BIN
plugin/component_validate_password.dll
Normal file
Binary file not shown.
BIN
plugin/connection_control.dll
Normal file
BIN
plugin/connection_control.dll
Normal file
Binary file not shown.
BIN
plugin/ddl_rewriter.dll
Normal file
BIN
plugin/ddl_rewriter.dll
Normal file
Binary file not shown.
BIN
plugin/debug/adt_null.dll
Normal file
BIN
plugin/debug/adt_null.dll
Normal file
Binary file not shown.
BIN
plugin/debug/adt_null.pdb
Normal file
BIN
plugin/debug/adt_null.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_audit_api_message_emit.dll
Normal file
BIN
plugin/debug/component_audit_api_message_emit.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_audit_api_message_emit.pdb
Normal file
BIN
plugin/debug/component_audit_api_message_emit.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_connection_control.dll
Normal file
BIN
plugin/debug/component_connection_control.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_connection_control.pdb
Normal file
BIN
plugin/debug/component_connection_control.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_keyring_file.dll
Normal file
BIN
plugin/debug/component_keyring_file.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_keyring_file.pdb
Normal file
BIN
plugin/debug/component_keyring_file.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_filter_dragnet.dll
Normal file
BIN
plugin/debug/component_log_filter_dragnet.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_filter_dragnet.pdb
Normal file
BIN
plugin/debug/component_log_filter_dragnet.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_sink_json.dll
Normal file
BIN
plugin/debug/component_log_sink_json.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_sink_json.pdb
Normal file
BIN
plugin/debug/component_log_sink_json.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_sink_syseventlog.dll
Normal file
BIN
plugin/debug/component_log_sink_syseventlog.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_log_sink_syseventlog.pdb
Normal file
BIN
plugin/debug/component_log_sink_syseventlog.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_mysqlbackup.dll
Normal file
BIN
plugin/debug/component_mysqlbackup.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_mysqlbackup.pdb
Normal file
BIN
plugin/debug/component_mysqlbackup.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_query_attributes.dll
Normal file
BIN
plugin/debug/component_query_attributes.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_query_attributes.pdb
Normal file
BIN
plugin/debug/component_query_attributes.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_reference_cache.dll
Normal file
BIN
plugin/debug/component_reference_cache.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_reference_cache.pdb
Normal file
BIN
plugin/debug/component_reference_cache.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/component_validate_password.dll
Normal file
BIN
plugin/debug/component_validate_password.dll
Normal file
Binary file not shown.
BIN
plugin/debug/component_validate_password.pdb
Normal file
BIN
plugin/debug/component_validate_password.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/connection_control.dll
Normal file
BIN
plugin/debug/connection_control.dll
Normal file
Binary file not shown.
BIN
plugin/debug/connection_control.pdb
Normal file
BIN
plugin/debug/connection_control.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/ddl_rewriter.dll
Normal file
BIN
plugin/debug/ddl_rewriter.dll
Normal file
Binary file not shown.
BIN
plugin/debug/ddl_rewriter.pdb
Normal file
BIN
plugin/debug/ddl_rewriter.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/group_replication.dll
Normal file
BIN
plugin/debug/group_replication.dll
Normal file
Binary file not shown.
BIN
plugin/debug/group_replication.pdb
Normal file
BIN
plugin/debug/group_replication.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/ha_example.dll
Normal file
BIN
plugin/debug/ha_example.dll
Normal file
Binary file not shown.
BIN
plugin/debug/ha_example.pdb
Normal file
BIN
plugin/debug/ha_example.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/ha_mock.dll
Normal file
BIN
plugin/debug/ha_mock.dll
Normal file
Binary file not shown.
BIN
plugin/debug/ha_mock.pdb
Normal file
BIN
plugin/debug/ha_mock.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/keyring_udf.dll
Normal file
BIN
plugin/debug/keyring_udf.dll
Normal file
Binary file not shown.
BIN
plugin/debug/keyring_udf.pdb
Normal file
BIN
plugin/debug/keyring_udf.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/libpluginmecab.dll
Normal file
BIN
plugin/debug/libpluginmecab.dll
Normal file
Binary file not shown.
BIN
plugin/debug/libpluginmecab.pdb
Normal file
BIN
plugin/debug/libpluginmecab.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/locking_service.dll
Normal file
BIN
plugin/debug/locking_service.dll
Normal file
Binary file not shown.
BIN
plugin/debug/locking_service.pdb
Normal file
BIN
plugin/debug/locking_service.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/mypluglib.dll
Normal file
BIN
plugin/debug/mypluglib.dll
Normal file
Binary file not shown.
BIN
plugin/debug/mypluglib.pdb
Normal file
BIN
plugin/debug/mypluglib.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/mysql_clone.dll
Normal file
BIN
plugin/debug/mysql_clone.dll
Normal file
Binary file not shown.
BIN
plugin/debug/mysql_clone.pdb
Normal file
BIN
plugin/debug/mysql_clone.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/mysql_no_login.dll
Normal file
BIN
plugin/debug/mysql_no_login.dll
Normal file
Binary file not shown.
BIN
plugin/debug/mysql_no_login.pdb
Normal file
BIN
plugin/debug/mysql_no_login.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/rewrite_example.dll
Normal file
BIN
plugin/debug/rewrite_example.dll
Normal file
Binary file not shown.
BIN
plugin/debug/rewrite_example.pdb
Normal file
BIN
plugin/debug/rewrite_example.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/rewriter.dll
Normal file
BIN
plugin/debug/rewriter.dll
Normal file
Binary file not shown.
BIN
plugin/debug/rewriter.pdb
Normal file
BIN
plugin/debug/rewriter.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/semisync_replica.dll
Normal file
BIN
plugin/debug/semisync_replica.dll
Normal file
Binary file not shown.
BIN
plugin/debug/semisync_replica.pdb
Normal file
BIN
plugin/debug/semisync_replica.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/semisync_source.dll
Normal file
BIN
plugin/debug/semisync_source.dll
Normal file
Binary file not shown.
BIN
plugin/debug/semisync_source.pdb
Normal file
BIN
plugin/debug/semisync_source.pdb
Normal file
Binary file not shown.
BIN
plugin/debug/validate_password.dll
Normal file
BIN
plugin/debug/validate_password.dll
Normal file
Binary file not shown.
BIN
plugin/debug/validate_password.pdb
Normal file
BIN
plugin/debug/validate_password.pdb
Normal file
Binary file not shown.
BIN
plugin/group_replication.dll
Normal file
BIN
plugin/group_replication.dll
Normal file
Binary file not shown.
BIN
plugin/ha_example.dll
Normal file
BIN
plugin/ha_example.dll
Normal file
Binary file not shown.
BIN
plugin/ha_mock.dll
Normal file
BIN
plugin/ha_mock.dll
Normal file
Binary file not shown.
BIN
plugin/keyring_udf.dll
Normal file
BIN
plugin/keyring_udf.dll
Normal file
Binary file not shown.
BIN
plugin/libpluginmecab.dll
Normal file
BIN
plugin/libpluginmecab.dll
Normal file
Binary file not shown.
BIN
plugin/locking_service.dll
Normal file
BIN
plugin/locking_service.dll
Normal file
Binary file not shown.
BIN
plugin/mypluglib.dll
Normal file
BIN
plugin/mypluglib.dll
Normal file
Binary file not shown.
BIN
plugin/mysql_clone.dll
Normal file
BIN
plugin/mysql_clone.dll
Normal file
Binary file not shown.
BIN
plugin/mysql_native_password.dll
Normal file
BIN
plugin/mysql_native_password.dll
Normal file
Binary file not shown.
BIN
plugin/mysql_no_login.dll
Normal file
BIN
plugin/mysql_no_login.dll
Normal file
Binary file not shown.
BIN
plugin/rewrite_example.dll
Normal file
BIN
plugin/rewrite_example.dll
Normal file
Binary file not shown.
BIN
plugin/rewriter.dll
Normal file
BIN
plugin/rewriter.dll
Normal file
Binary file not shown.
BIN
plugin/semisync_replica.dll
Normal file
BIN
plugin/semisync_replica.dll
Normal file
Binary file not shown.
BIN
plugin/semisync_source.dll
Normal file
BIN
plugin/semisync_source.dll
Normal file
Binary file not shown.
BIN
plugin/validate_password.dll
Normal file
BIN
plugin/validate_password.dll
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user